Hello,
I am using a table in MySQL called "submissions" that contains fields called "loginid" and "datesubmitted." "Loginid" is an integer and "datedubmitted" is a timestamp.
I would like to make a function that will determine whether or not a given "$uid" equals a "loginid" that has 11 or more rows in "submissions" with a "datesubmitted" of today's calendar date.
I'm not sure how to make this, but this is what I have so far:
function uidlimit($uidinput){
$queryuid = "select uid from submission where datesubmitted > '$todaysDate 00:00' and date < '$todaysDate 23:59' group by uid having count() > 11";
$uidresult = mysql_query($queryuid);
Any advice on how I can make such a function?
Thanks in advance,
John
EDIT: Thanks to Pekka, I ended up using this, which works:
$queryuidcount = "select loginid from submission where TO_DAYS(datesubmitted) = TO_DAYS(NOW()) AND loginid = '$uid'"; // Remove line breaks
$uidresult = mysql_query($queryuidcount);
if (mysql_num_rows($uidresult) >= 11)
{
session_write_close();
header("Location:http://www.domain.com/sample/index.php");
exit;
}