Support the ongoing development of Laravel.io →
Database Laravel
Last updated 1 year ago.
0
moderator

Hello,

My first question is: why do you want to use MySQLi? In basic changing the driver shouldn't change the working of your application (because of the abstraction of the database layer) If you use the ORM ( https://laravel.com/docs/5.7/eloquent ) or the database part: https://laravel.com/docs/5.7/database you don't need to worry about what it is using.

But maybe I don't really understand your question.

0

Hi Tobias,

Thanks for answering.

My question is more geared towards(MySQL Vs MYSQLi in PDO). Let me admit, I am a novice with PDO and Laravel. So please bear with me.

Following the note, If you are using MySQL versions 4.1.3 or later it is strongly recommended that you use the mysqli extension instead. (Src:http://www.php.net/manual/en/mysqli.overview.php)

My understanding of PDO: I see PDO as an API which supports multiple database drivers, like MySQL,sqlite,pgsql,sqlsrv. But according to my understanding MySQLi driver is more current and with new features than MySQL driver, not seeing MySQLi as an option of the PDO API, I am more curious.

Earlier, this was the recommendations from our consultants: • PHP's MySQL Extension - The original MySQL extension • PHP's MySQLi Extension - the MySQL improved extension • PHP Data Objects (PDO) - the main disadvantage is that it doesn't allow you to use all of the advanced features that are available in the latest versions of MySQL server

So, I am analyzing the advantages and disadvantages, before actually migrating the existing system.

Thanks again, Khushbu

0
moderator

Hello Khushbu,

You first had the MySQL driver, later the MySQLi driver was created with a new approach. PDO is an API but has new drivers for the database connection. So the PHP driver for PDO isn't the same as the driver for the mysql_* functions. In fact the PDO driver is the newest one in PHP.

0

Oh great!! I got it, you solved all my confusions. Thanks a lot Tobias.

It seems I was just confused with the words "MySQL and MySQLi". To rephrase, MySQL is a generalized phrase for MySQL and MySQLi in PDO. MySQL driver used in PDO is the most updated and it includes all the latest features of MySQLi extension. It's just we won't be able to use mysqli_query any more with PDO.

Thanks, Khushbu

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.