StanLytle
08-08-2007, 07:02 PM
I'm stumped. I finally got rid of all the MySQL error messages, but the "if" part doesn't seem to work. I want to count the number of Active='0' photos a user has, and if more than ten, then exit the upload process with a message. My problem seems to be with " COUNT(UserID) AS QueueCount" and "if ($QueueCount > 10)". Any suggestions? Here's what I have:
if ($UserLevel == '4')
{
$query = "SELECT PhotoID, COUNT(UserID) AS QueueCount FROM Photos WHERE (Active = '0') AND (UserID = '$SessionUserID') GROUP BY UserID";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
if ($QueueCount > 10)
{
print "You have reached your upload limit.";
print "When your submissions have been processsed,";
print "you will be able to resume uploading";
require ("Footer.php");
exit;
}
}
}
Thanks,
Stan
if ($UserLevel == '4')
{
$query = "SELECT PhotoID, COUNT(UserID) AS QueueCount FROM Photos WHERE (Active = '0') AND (UserID = '$SessionUserID') GROUP BY UserID";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
if ($QueueCount > 10)
{
print "You have reached your upload limit.";
print "When your submissions have been processsed,";
print "you will be able to resume uploading";
require ("Footer.php");
exit;
}
}
}
Thanks,
Stan