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

From: Date: Tue, 18 Feb 2003 08:41:51 +0000
Subject: Re[2]: [PHP-DB] More help with mysql -- solved (bizarre)
References: 1 2 3 4 5 6  Groups: php.db 
Request: Send a blank email to php-db+get-25721@lists.php.net to get a copy of this message
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]

« previous php.db (#25721) next »