Pages

Tuesday, November 6, 2012

Difference in == & === with example

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)
{
}

1 comment:

  1. Good article

    https://wordpress-special-plugin.blogspot.co.id

    ReplyDelete