$total = $mysqli->query("SELECT COUNT(`user_id`) FROM `users` WHERE `user_name` = '{$user}' AND `user_password` = '{$pass}'");
$row = $total->fetch_row();
return ($row[0] == 1) ? true : false;
Re: how to convert MySQL to MySQLi
Posted: Fri Sep 27, 2013 8:48 am
by 9pleum
Ohh, thank you
Re: how to convert MySQL to MySQLi
Posted: Sun Nov 03, 2013 1:11 pm
by Voiceeeeee
Here's something that helped me when I decided to use MySQLi over MySQL, I hope it'll help you and other users.
$cxn is the connection variable.
If you want a function that's not in the image then just search for it in the PHP Docs and you'll see a warning saying MySQL is deprecated linking to the exact MySQLi and PDO function.
Re: how to convert MySQL to MySQLi
Posted: Sun Nov 03, 2013 1:33 pm
by Temor
That is actually pretty useful. Neat table.
Wish I had that back when..
Re: how to convert MySQL to MySQLi
Posted: Wed Nov 06, 2013 2:10 am
by killfrog47
Voiceeeeee wrote:Here's something that helped me when I decided to use MySQLi over MySQL, I hope it'll help you and other users.
$cxn is the connection variable.
If you want a function that's not in the image then just search for it in the PHP Docs and you'll see a warning saying MySQL is deprecated linking to the exact MySQLi and PDO function.
Nice! Im gonna have to save that table because I can NEVER remember these things lol im always googling the old MySQL way to see the MySQLi equivalent