How to use MySQLi in PHP

It's only fair to share...Share on Facebook0Share on Google+0Tweet about this on Twitter0Share on LinkedIn0Pin on Pinterest1Digg thisShare on StumbleUpon1


After deprecation of MySQL extension, people uses PDO or MySQLi to interact with database. Here we will discuss how to use MySQLi for our basic needs like select, insert, update and delete records using PHP. In MySQLi, “i” stands from “improved”. Why we use MySQLi? MySQLi is object oriented and support Prepared Statements which are very important for security as they protect from SQL injection.

Database connection:

 SELECT Record:

Insert Record:

 Update Record:

 Delete Record:




  1. By mario


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">