Jump to content

query doesn't yield correct result


StanLytle

Recommended Posts

What I'd like to do, is look into a table, to see if a person has had more than x number of rejections (ie: 10), in the past 10 days.  I'm not getting anymore mySQL errors, but this just outputs "You can upload pictures" over and over and over again. Any help appreciated.

 

$RejectCutOffTime = strtotime('-10 days');

$query = "SELECT UserID, COUNT(UserID) FROM Rejections WHERE (Date > '$RejectCutOffTime') GROUP BY UserID ORDER BY UserID";

$result = mysql_query($query) or die(mysql_error());

while(list($id, $ct) = mysql_fetch_row($result))

{

if (($SessionUserID == $id) AND ($ct > '10'))

{ print "You have too many rejections to upload pictures"; }

else

{ print "You can upload pictures"; }

}

 

Link to comment
https://forums.phpfreaks.com/topic/150280-query-doesnt-yield-correct-result/
Share on other sites

Yes.  With some help  (thanks guys) I was able to output (view) the contents of the table by the cutoff time I wanted.  See:

 

http://www.phpfreaks.com/forums/index.php/topic,243819.0.html

 

for reference.  Now I want to use the data, find a specific person, without displaying the table.

 

Stan

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.