hello....
how to stop submitting user's input, if his last input was submitted less then one minute ago.
please see this mysql sturcture
table SMANSAKRA
ID | text_input | date
the "date" here is "NOW()" value when the user submit his input.
i want to select the user input that submitted more than one minutes ago by using this code,
but never success:
// db_arr is a function from other file
$delay = 1;
$count_arr = db_arr("SELECT COUNT( * ) AS `my_count` FROM `shoutbox` WHERE `id` = '$id' AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(date)) < $delay ");
if ( $count_arr['my_count'] == 0 ) echo "congratulations you can submit to database";
else echo "please wait until 1 minutes";
BUT , it always display "please wait until 1 minutes" although it had been more than 2 minutes
can anyone help me to fix code above ...? thanks
Bookmarks