Hi, I'm currently working on a support page. Right now, it successfully allows a user to type in a question, where the information is inserted into my database. With one flaw though. There is a check that ensures the user doesn't have more than 3 questions at a time. I need to have this check for questions that also have a status "answered" set to 'no'. For example: For every question that the user asks, the answered status is set to 'no' by default. If the user has more than 3 unanswered questions at any time, they won't be able to ask another question. If they have 5 questions they have asked though perhaps, but 4 are set to 'yes', and 1 is set to 'no, they will be able to ask a question. What should I change to get this to work properly? Thanks
modify this line $checkmessage = mysql_query("SELECT message FROM `support` WHERE `message`='{$message}' and `answered` = 'no' "); PHP:
That wouldnt check just for that customer though, I assume the limit of 3 will be per customer rather than in total. I would need something like this.. $checkmessage = mysql_query("SELECT message FROM `support` WHERE `userid`='{$userid}' AND `answered`='no'"); PHP: