Update Record
Create Form
insert(
'user_details',
array(
'name' => $name,
'gender' => $gender,
),
array('%s', '%s')
);
}
// Query to select data from the user_details table
$query = "SELECT * FROM user_details ORDER BY id DESC";
$results = $wpdb->get_results($query);
// Display the results in a table
echo " ";
echo "ID Name Gender Entry Time ";
foreach ($results as $row) {
echo "";
echo "" . $row->id . " ";
echo "" . $row->name . " ";
echo "" . $row->gender . " ";
echo "" . $row->entry_time . " ";
echo " ";
}
echo "
";
?>
Submit Details
Submit Form
Submitted Details
insert(
$table_name,
array(
'name' => $name,
'gender' => $gender,
),
array('%s', '%s')
);
// Check for errors
if ($result === false) {
echo $wpdb->last_error;
} else {
// Output JavaScript for displaying the success message and redirecting
echo '
';
exit;
}
}
?>