I believe if you put OR instead of || it will work OK as originally posted..

ie mysql_query("SELECT * FROM SOME_TABLE") OR die(....


-----Original Message-----
From: Max 'AMiGo' Gashkov [mailto:[EMAIL PROTECTED]]
Sent: 18 February 2003 08:42
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
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"))

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
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
[EMAIL PROTECTED] ]=[ 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

This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your

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

Reply via email to