Friday, 6 July 2018

How to use MySQLi_connect in PHP

As you all knows that MySQLi is improved PHP extension of MySQL which is introduced in PHP 5. MySQL is deprecated in PHP 5.5 will be removed in future. We have millions of applications using PHP MySQL and needs to be updated on MySQLi or PDO (PHP Data Objects is also a new extension you can use to use in your applications). So today i am going to give you a very simple integration guide of MySQLi how to connect to a database, how to  run a query and insert records etc hope you love this article.
how-to-use-mysqli_connect-in-php
Example of mysqli connection with the object method:
Example of mysqli connection with the procedural method:
Connection error checking with object method:
Connection error checking with procedural method:
Escaping characters with mysqli real escape:
Simple procedure with complete code with procedural method:

0 comments:

Post a Comment