$a=$_GET['id'];
$sql="SELECT * FROM users where id = '" . $a . "'";
$search=mysql_query($sql);
$x=mysql_fetch_assoc($search);
if ((time()-$x['last_date']) > 24*60*60){
$sql="UPDATE users set points=".($x['points']+1).", last_date='". time() . "' where id = '" . $a . "'";
$xx=mysql_query($sql)...