query help
Posted: Tue Sep 26, 2006 7:25 am
How do I get the number items I query without looping out my result?
This problem is coming up for me as I'm working on a photo album. I display a thumb for each album that the user can select and list how many pictures are in that album, but obviously I wouldn't want display anything from those albums I only need the number of pictures.
How do put the number of results in a variable?
This problem is coming up for me as I'm working on a photo album. I display a thumb for each album that the user can select and list how many pictures are in that album, but obviously I wouldn't want display anything from those albums I only need the number of pictures.
Code: Select all
$sql = "SELECT picture_id FROM pictures
WHERE picture_albumid = something";
$results = mysql_query($sql);