Yes - that's most likely the answer.. if the echo doesn't help, try
something like this..

$result2 = mysql_query($query2,$db) or die(mysql_error());

If mysql is throwing up an error, that'll present it too you and stop
execution..



-----Original Message-----
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: 11 February 2002 03:39
To: Brad Wright
Cc: PHP General List
Subject: Re: [PHP] 2 conditions why wont they work??


Do an echo($clientID) before - it most probably is either empty or it's a
string and MySQL actually issues errors there.

Bogdan

Brad Wright wrote:

> Hi all,
> Im was sure you could select a row from a mySQL database based on 2
> conditions. My code:
>
> $query2 = "select * from Table where  userNo = $userNo and clientID =
> $clientID";
> $result2 = mysql_query($query2,$db);
>
> This returns :
> Warning: Supplied argument is not a valid MySQL result resource
>
> b ut if i change the line to:
> $query2 = "select * from Table where  userNo = $userNo;
> $result2 = mysql_query($query2,$db);
>
> it works (but get all the rows with userNo = $userNo.
>
> HELP!!!! Im sure this should work...what am i doing wrong???
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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


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

Reply via email to