Thanks kindly to the people who have contributed so far however may be I 
haven't quite explained it right so here goes again-

I have the following query-

"SELECT productid,title FROM product WHERE
categoryid='".addslashes($_GET[cid])."' AND display='1' ORDER BY title ASC 
LIMIT $st,$pp"

The above is a loop, it can return multiple results.

I want to run a sub query to obtain further information, with the 'select' 
criteria being based on the result of 'productid' above, like-

"SELECT count(*) FROM picture WHERE productid='(productid from the last 
query)' AND (field 'pic' blob size) > 0 LIMIT 1"

In the sub query I just want to know if a row *exists* and use this to switch 
a PHP 'if' statement.

FYI - 'pic' is a BLOB field containing an image.

Michael

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to