if(isset($_POST['BtnSubmit'])) {
global $wpdb;
$data_array = array(
'myname' => $_POST['myname'],
'statename' => $_POST['statename'],
);
$table_name = 'form_entry';
$rowResult = $wpdb ->insert($table_name, $data_array, $format=NULL);
if($rowResult == 1) {
echo 'Success';
}
else {
echo ' Error in my pant';
}
die;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter