What is MySQLi? What does it do?

MySQLi is an extension for PHP, often referred to as MySQL improved. It was introduced in PHP 5.0, and will be in every version following (until something better comes along). It allows you to use all of the MySQL database (version 4.1.3 or newer) servers features. Some features of MySQLi are (from the PHP manual):

MySQLi not only has an object oriented interface but also a prodecural one. Making it even more widely usable.

Example of connection with the object oriented method:

<?php
$sql = new mysqli('localhost','username','password','database');
?>

Example of connection with the procedural method:

<?php
$link = mysqli_connect('localhost','username','password','database');
?>

And that is a nice, quick, simple introduction to the MySQLi extension for PHP.

Author: Mike on March 23, 2011
Category: MySQLi
Tags: , ,

4 thoughts on “What is MySQLi? What does it do?”

  1. Robin says:

    TYVM you’ve solved all my problems

    1. Mike says:

      Glad it helped.

  2. frustrated says:

    What does this error mean?

    Fatal error: Class ‘mysqli’ not found?

    how do i fix it?

    1. Mike says:

      You would have to use a newer version of PHP that has the class compiled in.

Comments are closed.

Last articles