php-general | 2001032

RE: [PHP] RE: [PHP-DB] Best way to check if a query succeeded From: Boget, Chris (Chris.Boget <email protected>)
Date: 03/30/01

> Wouldn't doing it like this however be ok:
> if ($result = mysql_query($query)) {

I could be wrong, but I do not believe so. The
above would evaluate as _true_ 100% of the
time because irregardless of success of the query,
$result is getting a value. It's just like doing:

$i = "joe";
if( $i = "bob" ) {
  // this will always run.

}

Again, I could be wrong but don't think I am.

Chris