I'm trying in my visitor-book that people can do only one post in one day, but I don't know how it goes. Here's the code:
<?php
$user = $username;
$timestamp = time();
$date = date("Y.m.d", $timestamp);
// Look if the user has written something..
$sql="SELECT user, date FROM book WHERE user='$user' AND date=???";
$qry=mysql_query($sql);
$num_rows = mysql_num_rows($qry);
mysql_query($sql);
if($num_rows > 0) {
?>
Today you have written.
<?php
} else {
?>
Action....
<?php } ?>
I'm sure that $date
can't be at "???" because $date
is the current date. I need the date of the record in the database.