1) Simplicity. Mysqli is object oriented. It's simple to use. You create an object and pass your database information to the constructor. And you're all set.

$mysqli = new Mysqli("localhost", "username", "password", "database");
$query = $mysqli->query("YOUR QUERY");
$row = $query->fetch_object();
echo $row->result;

2) Speed. Mysqli is newer and runs faster than Mysql.

3) Cleanliness and Organization. You will be more organized using Mysqli, Mysql is cluttered.

I highly recommend making the switch to Mysqli, you won't regret it.

I would prefer PDO over Mysqli since it is not tied to a single database product (MySQL). With PDO, you can have the choice of database product to use, and thus if you wanted to change the databse product you use from MySQL to SQLite, it is simpler.

ie: PDO has drivers for the major database products, Mysqli is MySQL specific.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.