Yep, you're right Paul, it is a bad query, one thing I've been burnt on a lot

in the past, is using the variables inside those double quoted lines. I've
started expanding everything, mostly objects and arrays won't get interpreted

correctly,  try building the query in a string, and then printing out the
string to the screen and see if it looks right, and then execute that mysql
command from the mysql command line, and see if it flies, bet it won't.

KL

PS: Sorry about sending you that last message Paul, I'm still not used to the
reply all, and I just use that all too easy reply button :(



Paul DuBois wrote:

> >Paul,
> >
> >It is not an error for $category to be 'no' in all records.  The warning
> >is just telling me that it didn't find any 'yes' records.
>
> Well, no, it is not.  The error you showed was:
>
> Warning: Supplied argument is not a valid MySQL result resource in
> {pathname to program} on line 40
>
> PHP is telling you that $res does not refer to a valid result set.
> That means your query *failed with an error*, not that
> it executed properly and returned no records.
>
> >
> >I need to read up and find out how to error check the SELECT statement,
> >I guess...
>
> Yes.  Try this, for example:
>
> if (!$res)
>      die ("query failed, error message is: " . mysql_error ());
>
> >
> >
> >-tom
>
> --
> Paul DuBois, Senior Technical Writer
> Madison, Wisconsin, USA
> MySQL AB, www.mysql.com
>
> Are you MySQL certified?  http://www.mysql.com/certification/
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to