Hi there ! I need to check if a record exists and if it doesn't it gives an error message. if (!mysql_query("EXISTS(SELECT * FROM kunder WHERE id='$id')")) { echo "Record doesn't exist"; exit; }
This doesn't work... What am i doing wrong ?
nevermind, just used: $g_total = mysql_query("SELECT count(id) AS total FROM kunder WHERE id='$id'") or die(mysql_error()); $total = mysql_result($g_total,0); and then if total == 0 it doesn't exist.