RE: [PHP] RE: [PHP-DB] Best way to check if a query succeeded
| From: | Boget, Chris | Date: | Fri, 30 Mar 2001 14:25:26 +0000 |
| Subject: | RE: [PHP] RE: [PHP-DB] Best way to check if a query succeeded | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-46313@lists.php.net to get a copy of this message | ||
> 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