hello, I want to save a query only one time in the database, this is my code:
$querystat = mysql_real_escape_string($_GET['q']);
$datetime = time();
if( ($querystat != $_SESSION['prev_search']) OR ( ($datetime - $_SESSION['datetime']) > 60) ) {
$insertquery = "INSERT INTO `query` ( `searchquery` , `datetime`) VALUES ( '$querystat' , '$datetime') ON DUPLICATE KEY UPDATE searchquery='$querystat';";
mysql_query($insertquery, $db);
}
maybe something with == 0
?