How do all..
I am trying to finish up an Image Gallery hack and am having some trouble with the admin piece..
I am trying to first count all the images in my image table.. No problems there.. The Image table entries are linked to the postid that image was uploaded in.. I am trying to count the postid's that match the postid's in the image table..
Here is what I have so far..
The problem is that the count for the post table always equals one.. I know for a fact that the count should be 13 since that is what the count of the image table is reporting..
Any help would greatly appreciated..
Herb..
I am trying to finish up an Image Gallery hack and am having some trouble with the admin piece..
I am trying to first count all the images in my image table.. No problems there.. The Image table entries are linked to the postid that image was uploaded in.. I am trying to count the postid's that match the postid's in the image table..
Here is what I have so far..
Code:
$totalimagesq=$DB_site->query_first("SELECT COUNT(imagegalid) AS imagegalid FROM imagegal"); $totalimages=$totalimagesq[imagegalid]; $images=$DB_site->query("SELECT imagegalid,postid FROM imagegal"); while ($imagesd=$DB_site->fetch_array($images)) { $totalpostsq=$DB_site->query_first("SELECT COUNT(postid) AS postid FROM post WHERE postid='$imagesd[postid]'"); $totalposts=$totalpostsq[postid]; } echo "<p>There are $totalimages images in the image gallery table. <BR>There are $totalposts posts that contain images in the posts table. <BR><a href=\"imagegal.php?action=doclean\">Delete Dead Images</a></p>\n";
Any help would greatly appreciated..
Herb..
Comment