How can i count upload images per album based on user id..i have done this but is not ok..some help is appreciated. I'm new learner!
Here is what i have:
Album db: |albumid|name|image|uid| <- user id
Gallery db: |galleryid|albumid|name|images|uid|
Code
$sql = "
SELECT COUNT(userid)
FROM tbl_gallery
where userid = 1
";
$rs_result = mysql_query($sql,$con);
$row = mysql_fetch_row($rs_result);
$total_records = $row[0];
echo $total_records;
$sql = "SELECT * FROM tbl_album where userid = 1 ORDER BY albumid";
$rs_result = mysql_query($sql,$con);
####### Fetch Results From Table ########
while ($row = mysql_fetch_assoc($rs_result))
{
$aimage=$row['image'];
$aid=$row['albumid'];
$aname=$row['name'];
<div class="pic">
<?php
echo "<a href='includes/galeriefoto/gallery.php?id=1'> <img src='includes/galeriefoto/admin/acatch/$aimage' class='thumbimg' alt='Pic' alt='$aname'>";
?>
<span class='pic-caption'>
<center><p style='color:#000;font-size:24px'><?php echo $aname;?> (<?php echo $total_records;?>)</p></center>
</span></a>
</div>
<?php } ?>