Re: [PHP] Invalid Argument ??? Not sure how to debug this

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, Daniel Negron/KBE wrote:
>  $sql= "SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'
> ORDER BY artist ASC";

How about:

   SELECT * FROM cd_list WHERE searchstring LIKE '%{$searchstring}%' 

Then again, do you actually have a column called "searchstring" in your 
table? 

In any case, the way you had it didn't seem to make much sense unless you 
wanted to search a user-supplied column for a string that literally 
contained the string "searchstring".

miguel


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




Re: [PHP] Invalid Argument ??? Not sure how to debug this

2002-03-17 Thread Jason Wong

On Sunday 17 March 2002 16:38, Daniel Negron/KBE wrote:
> Hi all and Good Morning.
>
> I have been struggling with this code:  I was wondering if someone could
> lend me a hand.
>
> I am working with this code and can't get the error to disappear.
>
> After running I get
>
> |--
> |---| Warning: Supplied argument is not a valid MySQL result
> | resource in C:\My Documents\My   | Webs\php\TMPibtpit3zq0.php on line 12 
> |  |
> | -
> ||
>
> Line 12 happens to be the WHILE statement.  I am not sure if it is the
> while statement or the results its looking for.

Put in some error checking code when you use the mysql functions as per the 
manual examples and you'll soon find where the error is.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
I'm having an emotional outburst!!
*/

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