I had a scenario in WordPress where to update and insert a record I used
$wpdb->insert and
$wpdb->update
now they both on success return "no of rows" and "1" on failure they return "0" and "0"(of type boolean which is false)
I was using same variable To check for their result as such on their failure I had to use I had to use
if($res= = =false)
{
}.
elseif($res= =0)
{
}
$wpdb->insert and
$wpdb->update
now they both on success return "no of rows" and "1" on failure they return "0" and "0"(of type boolean which is false)
I was using same variable To check for their result as such on their failure I had to use I had to use
if($res= = =false)
{
}.
elseif($res= =0)
{
}
Good article
ReplyDeletehttps://wordpress-special-plugin.blogspot.co.id