I have descided to change from mysql to mysqli part way through a project - and run into this hicup.
What is the best way to achieve this: //check if username is taken $result = mysql_result(mysql_query("SELECT COUNT(*) FROM user WHERE username='".$username."'"));
I can not find an exact version of mysql_result
I have tried this:
$result = mysqli_num_rows($db->query("SELECT * FROM user WHERE username='".$username."'"))
Which works but I think using count would be easier on the mySQL server. Is there a better way?