I am trying to convert my current code to MySQLi extension... But I have a problem with this code..
$sql = "SELECT COUNT(*) FROM users WHERE username='$username'";
$result = mysql_query($sql);
if (mysql_result($result, 0) > 0) {
$errors[] = 'The username is already taken.';
}
What is the mysqli function of "mysql_result" ? I can't get it work.
My current MySqLi code is just the connection and
$sql = "SELECT COUNT(*) FROM users WHERE username='$username'";
$result = $mysqli->query($sql);
if (mysql_result($result, 0) > 0) {
$errors[] = 'The username is already taken.';
}
But I need to change the mysql_result, but can't find the opposite function in MySQLi..