I'm trying to convert some of the mysql statements to mysqli.
I understand most of the conversions (i.e. mysqli_query just adds a connection as a parameter). One function I'm not understanding fully is the mysqli_result function. I have never used this before, so I am not sure as to how it works.
When I test out the code, I get an error such as:
Fatal error: Call to undefined function mysqli_result() in C:\xampp\htdocs\offstreams\core\functions\users.php on line 7
my code being:
$username = sanitize($username);
$sql = "SELECT COUNT (`user_id`) FROM `users` WHERE `username` = '$username'";
$query = mysqli_query($conn, $sql);
// In the video this is "mysql_result(...)...)..." //
return (mysqli_result($query, 0) == 1) ? true : false;
just like in the video: https://www.thenewboston.com/videos.php?video=19882
Could someone explain how to convert this code to fit mysqli?