I cant find any syntax for custom queries, use of $wpdb is new to me so can anyone help me solving this??
if(isset($_POST['submit']))
{
global $wpdb;
$tablename='wp_form_subscribe';
$myrows = $wpdb->get_results( "SELECT * FROM wp_form_subscribe where email=$wpdb->email" );
if($myrows==0)
{
$data=array(
'name' => $_POST['fullname'],
'age' => $_POST['age'],
'email' => $_POST['email']);
$wpdb->insert( $tablename, $data);
}
else
{
$status='User already subscribed';
}
$status='';
}