Welcome to the Browser-Base Game Zone forums!
"the mysqli set of functions is the newer+better way to use mysql now"why does everyone says that? MySQLi is a complete another Database, so before you use mysqli_* functions you have to install the MySQLi Database on your webspace. mysqli_* functions are the same like mysql_* the different between mysqli und mysqli is , that youre able to use mysqli as classes. youre able to use somethink like $sql = new mysqli($connectArray); and after it $sql->query("SELECT * Bla"); that would be the newer and better way, but if you use mysqli_connect or mysqli_select_db and such that would not be the better way.at the end, the Best way, which is used by most Frameworks is to use PDO or ORM which use the PDO.. but mysqli_* is not better than mysql_*
MySQLi is not "another database"; it's a newer library for php to deal with MySql
You can structure parameterized queries in a much more secure way instead of worrying so much about SQL injection attacks.
It follows OOP paradigms
Transaction support
Multiple query support
If you are using MySQL versions 4.1.3 or later it is strongly recommended that you use the mysqli extension instead. from the php docs
But your assumption that mysql is just as good is false.
Why is it said that MySQLi is better than MySQL? Anyone knows some details?I have not noticed people rewriting their code to the "i", so I'm a bit sceptical...
QuoteYou can structure parameterized queries in a much more secure way instead of worrying so much about SQL injection attacks.Only if you use Prepared Statments, else you have to Escape your Queries Anyways
QuoteIf you are using MySQL versions 4.1.3 or later it is strongly recommended that you use the mysqli extension instead. from the php docsActually MySQL version is 5.5.16, if your server isnt up to date then i would agree.
i agree that MySQli has more features to MySQL but only to telling them to use mysqli instead of mysql, they would just replace their function calls in the code and that would not be the better way... that is what iam tryin to say
Why would you not use prepared statements?
Quote from: ajacksified on October 14, 2011, 05:07:43 PMWhy would you not use prepared statements?For every query you are going to the database twice (once to prepare the sql and the second to execute the query). Prepared statements are expensive to run because of the additional trip to the server.