$scomprobarIP = "SELECT hitIP FROM hits where hitIP = 'xxx.xxx.xxx.xxx'" ; $res = mysql_query($comprobarIP); if (mysql_num_rows($res) == 0); { mysql_query("UPDATE hits SET hitTotal = hitTotal + 1"); }