[PHP-DB] Re: More help with mysql

2003-02-27 Thread Alexander Mejenkov
> Supplied argument is not a valid MySQL result resource.
This is absolutely correct because after
$result = mysql_query("SELECT * FROM SOME_TABLE") || die(mysql_error());

variable $result contains result of boolean "OR" operation which in your
case is TRUE or 1
in order to get valid MySQL result you should use

$result = mysql_query("SELECT * FROM SOME_TABLE");

Best regards
Sasha
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] More help with mysql -- solved (bizarre)

2003-02-27 Thread Alexander Mejenkov
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
news:[EMAIL PROTECTED]
> 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 doesn't work. It gives me: " Supplied argument is not a valid MySQL
> result resource"
>
> Anyway, since it works I don't suppose I should complain, but it seems
> pretty weird to me nevertheless.
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php