Ok may be I asked too much thats why I did’t get reply. However I figured out a lot. I am calling “wp_cf_form_entry_values” table (in which all entries available) through a template file. And its working fine.
BUT I have one problem remaining. My plan is that when user click on submit button then he/she redirected to a different page (template page in which I am calling ‘wp_cf_form_entry_values’ table from $wpdb). And there they can watch their detail (which they have added just now). But right now the page is showing whole record of the table BUT I want to show only their record
So can you at least tell me how can I call last submitted entry instead of whole table. I know a way ($last_insert_id = $wpdb->insert_id;) but that did’t work.
I know its somewhere in your plugin one line code that I need in my template file but can’t find out which one because so many files and code are available in your plugin.
So can you please tell me which line I need to add in my template file so that I can show user only their record as a preview.
Here is my code of template file :
<?php
/*
Template Name: Registration
*/
get_header();
global $wpdb;
//Create a mulit dimensional array for each slug.
$field_slugs = array();
//$last_insert_id = $wpdb->insert_id;
$fields = $wpdb->get_results( 'SELECT * FROM wp_cf_form_entry_values');
foreach($fields as $field){
$field_slugs[$field->slug][$field->entry_id] = $field->value;
}
//the table
echo '<table width="100%" border="1" cellspacing="1">';
$i=0;
foreach($field_slugs as $slug=>$values){
//the table header (only in the first loop)
/*if($i==0){
echo '<tr>';
foreach($values as $person_id=>$val){
echo '<th></th>';
echo '<th>Person '.$person_id.'</th>';
}
echo '</tr>';
}
*/$slug = str_replace('_', ' ', $slug);
$slug = ucwords($slug);
// one line per person
echo '<tr id="'.$slug.'">';
echo '<td><b>'.$slug.'</b></td>';
foreach($values as $person_id=>$val){
echo '<td>'.$val.'</td>';
}
echo '</tr>';
$i++;
}
if($i==0){
echo "<table width='100%' border='1' cellspacing='1'><tr><td>No Records Found</td></tr></table>";
}
echo '</table>';
get_footer();?>
I hope its not too much to ask