Hi,
I've got a sql line
"SELECT * from mytable where user = $user"
Now I want to do a if statement to see if there ant a record from that user?? how would I do that if statment???
assuming mySQL
$result = mysql_query("SELECT COUNT(*) FROM mytable WHERE user = '$user'") or exit(mysql_error()); if (mysql_result($result, 0)) {echo 'match found';} else {echo 'no match found';}