Anybody know why the this isn’t working:
$no = $_GET['no'];
$findinterval = mysql_query("SELECT * FROM intervals ORDER BY id DESC LIMIT 1");
$result = mysql_fetch_array($findinterval);
$id = $result['id'];
$ip = $_SERVER['REMOTE_ADDR'];
$create_log = mysql_query("INSERT INTO visitors VALUES ('','$ip','$date','$no','$id')");
The above works fine on insertion.
$uniquecheck = mysql_query("SELECT * FROM visitors WHERE no = '$no' AND interval = '$id' AND ip = '$ip'");`
var_dump is giving bool(false).
As the accepted answer verifies, the question was not vague at all. Nevertheless -4 it is.
intervalis a reserved word in mysql, so you need to put it in backticks:Apart from that the
mysql_*functions are deprecated and you should move to PDO / mysqli and prepared statements to close the sql injection hole you have now.