Sir, I don't see anything wrong with the syntax in your query. If I 
haven't over looked something, and if you haven't misspelled 
anything, then you have a data problem. Since your first query 
returns a Cartesian product, you should get something if the WHERE 
clause returns >= 1 row for each table. So either there are no rows 
in q that meet the conditions = '1' AND = '1'
or there are no rows in c that meet the condition = '1'
Run the first query with only the first WHERE condition. If you get 
rows, add the second condition. If that works, add the third. The 
point at which the query stops returning rows is the point at which a 
subset of your WHERE conditions  aren't met by the any of the rows in 
one of the tables.

BTW, why are you putting quotes around numbers? I'm assuming that's 
not the problem, since you say you did it in the query that worked, 
but I don't see the point.

Bob Hall

>Can anyone tell me why this:
>   Line 282    mysql_select_db("centraldb",$db);
>   Line 283    $qorder++;
>   Line 284    $result = mysql_query("SELECT q.questid, q.question, 
>q.answer, q.qorder, q.depart, q.catid,
>         ,, q.adate,, 
>q.authoremail, q.askemail, c.catid, c.category, c.under,
>                   c.corder, FROM central_groupfaqq q, 
>central_groupfaqcat c WHERE = '1' AND
>          = '1' AND = '1' ORDER BY 
>c.under, c.order, q.qorder",$db);
>   Line 285    while ($myrow = mysql_fetch_row($result))
>Would cause this error:
>   Warning: Supplied argument is not a valid MySQL result resource in 
>faqbody.php3 on line 285
>When changing the same SELECT statement to:
>   Line 284    $result = mysql_query("SELECT * FROM central_groupfaqq 
>WHERE active = '1' ORDER BY
>                    qorder",$db);
>Works perfectly?
>Keith Spiller
>a.k.a. Larentium

Know thyself? Absurd direction!
Bubbles bear no introspection.     -Khushhal Khan Khatak

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to