So, if both are available, which one should I choose?
Which one is better, MySQL or MySQLi?
Started by LuthfiHakim, Nov 26 2010 07:21 AM
7 replies to this topic
#1
Posted 26 November 2010 - 07:21 AM
|
|
|
#2
Posted 26 November 2010 - 11:37 AM
MySQLi is newer than MySQL regarding php part, and has the possibility for a object oriented usage. I'd chose MySQLi.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#3
Posted 26 November 2010 - 05:27 PM
Quote
The MySQLi Extension (MySQL Improved) is a relational database driver used in the PHP programming language to provide an interface with MySQL databases. MySQLi is an improved version of the older PHP MySQL driver, offering various benefits.[1] The developers of the PHP programming language recommend using MySQLi when dealing with MySQL server versions 4.1.3 and newer (takes advantage of new functionality).[1]
If I engage with php I would probably choose MySQLi.
Lost!
#4
Posted 27 November 2010 - 12:47 AM
Just note mysqli extension overhead is "huge", PDO_MySQL extension includes much richer feature set and its module is less than 1/5 the size, 1/2 of MySQL's.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Guest_Benwell_*
Posted 01 December 2010 - 03:44 AM
Guest_Benwell_*
I would go with MySQLi, which is based on the Object Oriented concepts more efficient than MySQL.
Edited by Orjan, 01 December 2010 - 12:17 PM.
Removed spamlink
#6
Posted 02 December 2010 - 12:39 AM
Sorry it took me so long to reply back, guys! Was having problem updating my computer.
Well, I am not a PHP programmer. My experience with PHP was only fixing some minor bugs and creating some "proxy" scripts (you know, using PHP to query/update database protected by webhosts). So I am not very familiar with the details. The reason I am asking is from end user perspective (ie. speed and maybe server load). I have several web sites and forums (to support my freeware users) which use CMS (Joomla and phpBB) which based on PHP. Each time I install them, I always been asked which one I want to use, MySQL or MySQLi.
So guys, what I need to know is from the end user perspective (i.e. speed) and maybe from the server itself (cpu load, hard drive read/write transactions), which one is the better one?
Well, I am not a PHP programmer. My experience with PHP was only fixing some minor bugs and creating some "proxy" scripts (you know, using PHP to query/update database protected by webhosts). So I am not very familiar with the details. The reason I am asking is from end user perspective (ie. speed and maybe server load). I have several web sites and forums (to support my freeware users) which use CMS (Joomla and phpBB) which based on PHP. Each time I install them, I always been asked which one I want to use, MySQL or MySQLi.
So guys, what I need to know is from the end user perspective (i.e. speed) and maybe from the server itself (cpu load, hard drive read/write transactions), which one is the better one?
#7
Posted 02 December 2010 - 09:33 AM
The MySQL functions are native and outdated, dating before PHP had any good OO support, the only reason why MySQLi module was invented was to add support for prepared statements (that send literal quotes, so nothing can affect the query) and of course an OO interface of which to do business with.
You can easily compare this to "C vs C++" in speeds, except there is no backend optimizing compiler behind the scenes. If you do not require the features or security of MySQLi then it is quite a slow method of speaking with MySQL driver in a majority of cases. The lack of speed will only be incremental (i.e. a larger site with massive dataset), and people tend to move away from MySQL to a faster option if available (NoSQL, etc) at that point.
In any case implementing a good caching system will far outweigh the differences, as there will be simply no need to use the (slow|faster) DBMS system much on the harder hitting sites.
You can easily compare this to "C vs C++" in speeds, except there is no backend optimizing compiler behind the scenes. If you do not require the features or security of MySQLi then it is quite a slow method of speaking with MySQL driver in a majority of cases. The lack of speed will only be incremental (i.e. a larger site with massive dataset), and people tend to move away from MySQL to a faster option if available (NoSQL, etc) at that point.
In any case implementing a good caching system will far outweigh the differences, as there will be simply no need to use the (slow|faster) DBMS system much on the harder hitting sites.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#8
Posted 02 December 2010 - 10:26 PM
^ Okay, so let me sum up.
MySQL:
- Faster
- Lower grade security
- Its speed could easily beaten by a good caching system
MySQLi
- Slower
- Better grade security
- Good caching system will nullified its slower speed.
The conclusion is that I'll have to use MySQLi, since both joomla and phpBB have caching system which (I believe) are good. Anyone would like to add, in case I am missing something?
Thanks NullW0rm, everyone!
MySQL:
- Faster
- Lower grade security
- Its speed could easily beaten by a good caching system
MySQLi
- Slower
- Better grade security
- Good caching system will nullified its slower speed.
The conclusion is that I'll have to use MySQLi, since both joomla and phpBB have caching system which (I believe) are good. Anyone would like to add, in case I am missing something?
Thanks NullW0rm, everyone!


Sign In
Create Account


Back to top









