1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 5.00 out of 5)

What is the difference between MySql and MySqli

What is the difference between MySql and MySqli? MySqli is the new and improved extension for MySql. The difference between MySql and MySqli is the way your write the code. For instance to connect to a database in MySql you would write the code something like this.

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

However MySql is becoming depreciated and will not longer be supported in future applications of PHP. In PHP5+ you will be encouraged to use the MySqli extension in your applications. TO connect to a database in MySqli you would write your code something like this.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂
$db = new mysqli("$host", "$username", "$password", "$dbname");
if($db->connect_errno > 0){
die('Unable to connect to database [' . $db->connect_error . ']');
}

Difference between MySql and MySqli *

The difference between MySql and MySqli is huge and MySqli gives us more Object Oriented Programming capabilities. We can handle data faster and more efficient in MySqli than we can in MySql.

 

Subscribe To My YouTube Channel:
What is the difference between MySql and MySqli was last modified: May 7th, 2015 by Maximus Mccullough

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Cool People Share:
difference between MySql and MySqli

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.