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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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"))
{
   die(....
};

EM> If I remove the '|| die' part from the mysql_query() statement, it works
EM> fine. This is bizarre, but there it is.

EM> ie, if I have:

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

EM> it works.

EM> If I have:

EM> $result = mysql_query("SELECT * FROM SOME_TABLE") || die ("Unable to execute
EM> SQL query");

EM> it doesn't work. It gives me: " Supplied argument is not a valid MySQL
EM> result resource"

EM> Anyway, since it works I don't suppose I should complain, but it seems
EM> pretty weird to me nevertheless.



WBR, Max 'AMiGo' Gashkov
amigo@otaku.ru ]=[ http://diary.otaku.ru/amigo
Distributed.net participant [408228][RC5-72]


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux