It's not bizarre behaviour
> $result = mysql_query("SELECT * FROM SOME_TABLE") || die ("Unable to
execute
> SQL query");
returns result of logical OR operation which is TRUE or 1
without || die(...) it returns valid MySQL resource
Regards
Sasha
"Evan Morris" <[EMAIL PROTECTED]> wrote in message
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 18 February 2003 08:26
>
> If I remove the '|| die' part from the mysql_query()
> statement, it works
> fine. This is bizarre, but there it is.
>
> ie, if I have:
>
> $result = mysql_query("SELECT * FROM S
Cc: [EMAIL PROTECTED]
Subject: Re[2]: [PHP-DB] More help with mysql -- solved (bizarre)
OK, now I see 8)
$result after your operations contains not SQL result, it's value is 1
(logical
TRUE) -- result of logical operation
mysql_query("SELECT * FROM SOME_TABLE") || die(
If yo
OK, now I see 8)
$result after your operations contains not SQL result, it's value is 1 (logical
TRUE) -- result of logical operation
mysql_query("SELECT * FROM SOME_TABLE") || die(
If you want to exit after error try this construction:
if(!mysql_query("SELECT * FROM SOME_TABLE"))
{
If I remove the '|| die' part from the mysql_query() statement, it works
fine. This is bizarre, but there it is.
ie, if I have:
$result = mysql_query("SELECT * FROM SOME_TABLE");
it works.
If I have:
$result = mysql_query("SELECT * FROM SOME_TABLE") || die ("Unable to execute
SQL query");
it