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
ROTECTED]>
EM> Sent: Tuesday, February 18, 2003 10:13 AM
EM> Subject: Re: [PHP-DB] More help with mysql
>> Possible error in SQL statement.
>> Are you sure that SOME_TABLE exists?
EM> Yes. I can connect to it from Perl, using the same user-pass credentials,
EM> and fet
Since I'm new to PHP, this concept is new to me. What does the @ do and
where do you put it?
- Original Message -
From: "Corne' Cornelius" <[EMAIL PROTECTED]>
To: "Evan Morris" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, Febru
- Original Message -
From: "Max 'AMiGo' Gashkov" <[EMAIL PROTECTED]>
To: "Evan Morris" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 18, 2003 10:13 AM
Subject: Re: [PHP-DB] More help with mysql
> Possible error in S
Yo Evan,
Have you got an '@' in front of the mysql_query() to supress errors ?
Evan Morris wrote:
Hi all
I have successfully managed to connect to the mysql database, using the
following code:
mysql_connect('localhost','php','***') || die ("Unable to connect to
MySQL server.");
$db = my
Possible error in SQL statement.
Are you sure that SOME_TABLE exists?
EM> Hi all
EM> I have successfully managed to connect to the mysql database, using the
EM> following code:
EM> mysql_connect('localhost','php','***') || die ("Unable to connect to
EM> MySQL server.");
EM> $db = mysql_selec
Hi all
I have successfully managed to connect to the mysql database, using the
following code:
mysql_connect('localhost','php','***') || die ("Unable to connect to
MySQL server.");
$db = mysql_select_db("DB_NAME") || die ("Unable to select requested
database.");
I then issue the following co
11 matches
Mail list logo