i have a question ?
Mysqli conection is very quick!
but wpdb class use mysql!!!!
i think if this class change and new class writen by mysqli is best.
is it?
i have a question ?
Mysqli conection is very quick!
but wpdb class use mysql!!!!
i think if this class change and new class writen by mysqli is best.
is it?
Yes it is. Actually in relation to PHP programming language, MySQL is the old database driver, and MySQLi is the Improved driver. MySQLi takes advantage of the newer features of MySQL 5. can go through http://www.phpzag.com/mysql/
tnks phpzag but why wordpress used MysqlDrive ?
Thanks for that insight. I assumed WP used MySQLi because of the $wpdb->prepare() statement, but as it seems it uses mysql_real_escape_string on all the parameters (among some other calls). Now I should reconsider some of my code designs.
Thanks All.
Voting over? :)
I'd go with MYSQL too.
mysqli is probably going to be used going forward. The reason it has not been used traditionally is that older versions of MySQL were supported and therefore mysqli could not be used. As of WP 3.2, MySQL 5 is the minimum requirement, thus making mysqli the new acceptable choice
By help of mysqli we can do batch statement query for say any transaction oriented situation.So that either all queries will be executed or none of them.
There are major difference between the Mysql and Mysqli extensions.
Unless you're using MySQL < 4.1 or PHP 4 you should be using the mysqli extension, even if you're using the procedural version of it. There is NO reason to be using the mysql extension, it is not receiving active development (only maintenance) releases and it can not utilize any of the new MySQL features since 4.1 (5.0, 5.1, and 5.5 have all been stable releases since), such as character sets, prepared statements, multiple statements, transactions, enhanced debugging, embedded server support etc.
Mysqli is also the suggested extension to be used for all new development.
The MySQLi driver is better than MySQL, on more modern versions of the MySQL database. The 'i' stands for improved, and it brings some performance advantages.
For new projects it is suggested to use the MySQLi driver.
I assume that WPDB still uses the old MySQL driver for compatability reasons, and as the above link states, the performance improvements are sometimes as low as 0.1%.
I used postgresql for experimental setup with modified WordPress. It works fine. Otherwise MySQL probably works better for production site.
You can check (there is no post, no cache plugin), notice the speed (copy paste the url) :
http://limitless-scrubland-5524.herokuapp.com/
Its a pain to add plugins or update it though.
Abhishek Ghosh, do you have any WordPress sites on the same server running on a MySQL(i) database connection? It would be interesting to compare the two.
I will test with MySQLi give the url here.
swatkats,
MySQLi is definately not slower, however it is not guarranteed to be faster in all circumstances.
Do not quote me on this as I can not quite remember, and can not find the source but speed improvements can be as low as 0.04 seconds.
@Abhishek, any luck? If we do not hear back within the next few days I will do it, and report my findings :)
Regards,
Shane
@swatkats : Painful result with MySQLi. All tested with Cloud Database from Rackspace.
MySQLi : http://www.webpagetest.org/result/121008_57_5TB/1/details/
MySQL : http://www.webpagetest.org/result/121008_BS_5W2/1/details/
Both were run with all default. Technically MySQLi should work better. Pathetically, many links to functions / pages within WordPress WP Admin panel (like Plugin browsing) returned errors after 'thinking' for few seconds.
PostgreSQL worked the best almost out of the box.
MySQL with HyperDB :
http://www.webpagetest.org/result/121008_M2_71Z/1/details/
MySQL with HyperDB with WP Super Cache and all tweaks :
http://www.webpagetest.org/result/121008_GP_85X/1/details/
~1 second loading time.
thanks for that data friend and very nice job on the last one! A+ :)
You are welcome alvaw and thanks for the A+.
Doesn't matter how you called it, Mysql remains Mysql... If you know what I mean. :)
There are however three extensions, that let php utilize the mysql features.
Namely:
1. mysql_* extension - which is the first, the worst, and official deprecated.
2. mysqli_* extension - which means 'improved' version. kk
3. And, mysql odbc - this is the best driver / extension, and I strongly encourage using it.
If I'm not mistaken the latest wp only supports odbc version, so if it gets successfully installed on your system you should worry about nothing.
Xarran BS - You did not mention the PDO extension.
http://jp2.php.net/manual/en/ref.pdo-mysql.php
Personally for all my databasing I use the MySQLi database connection, because I am only developing with MySQL databases. However if there is a chance you may be using multiple different DBMS, the PDO extension is most likely the best bet for you.
PDO_ODBC is a driver that implements the PHP Data Objects (PDO) interface...
So it's the same thing I guess? isn't it?
Well, I am not sure.
I have not used the ODBC driver - I assume that allows you to connect to many different DBMS?
There is a PDO_MYSQL, however I think the main difference is that it looks like PDO is specifically re-written for each DBMS - I will look into this soon and confirm this... And that PDO is object-oriented. Is the ODBC extension procedural or object-oriented?
And that PDO is object-oriented. Is the ODBC extension procedural or object-oriented?
PDO is object oriented, ODBC extension is procedural (As far I can recall).
By the way, I found a good DBMS comparison table - http://troels.arvin.dk/db/rdbms/
This topic has been closed to new replies.