At some point in your WordPress development career you may be presented with the need to write some custom mysql queries but how to do? don’t worry i write basic MySQL queries these may help you.
$ures = $wpdb->get_row("SELECT * FROM `custome_users` ORDER BY `id` DESC"); $ures ->name;
$ures = $wpdb->get_results("SELECT * FROM `custome_users` ORDER BY `id` DESC"); foreach ($ures as $uresfet) { $uresfet->name; }
$ures = $wpdb->get_results("SELECT * FROM `custome_users` ORDER BY `id` DESC"); $rows=$wpdb->num_rows;
$wpdb->query("DELETE FROM custome_users where id='$deleteid'");
$wpdb->query("UPDATE `sample_requests` SET `firstname` = '$firstname', `lastname` = '$lastname' WHERE `id` ='$id'");
My name is Mukesh Jakhar and I am a Web Application Developer and Software Developer, currently living in Jaipur, India. I have a Master of Computer Application in Computer Science from JNU Jaipur University. I loves to write on technology and programming topics. Apart from this, I love to travel and enjoy the beauty of nature.