Click to See Complete Forum and Search --> : PHP MySQL Vs MySQLi
Phill Pafford
12-05-2008, 12:02 PM
Question to all the PHP and MySQL gurus after searching the web on the topic to find benchmarks about which executes faster and more effectively (MySQL or MySQLi), I wanted to know the advantages of MySQLi over MySQL if any.
Why would I use MySQLi over MySQL?
This might be better to post in the PHP forum as well =P
NogDog
12-05-2008, 01:30 PM
This may help address some of your questions:
http://www.php.net/manual/en/mysqli.overview.php
scragar
12-05-2008, 01:49 PM
I still think I'm going to stick with MySQL for now, the MySQLi extension has a number of annoying bugs and annoyances, as long as using the "AS" key word throws an error I'm going to avoid it like the plague.
NogDog
12-05-2008, 02:14 PM
I still think I'm going to stick with MySQL for now, the MySQLi extension has a number of annoying bugs and annoyances, as long as using the "AS" key word throws an error I'm going to avoid it like the plague.
Can you provide any specifics on these "annoyances"? Are any/all of them known bugs in the PHP bug database (http://bugs.php.net/)? Any specific code examples of any of these bugs/annoyances?
PS: Please don't take the above as intended to be argumentative, I'd just like more info so that I can make a more informed evaluation/decision.
Phill Pafford
12-05-2008, 02:36 PM
Thanks for the link Nog.
I would still like to keep the thread open for others to post their views as well.
If anyone has done any benchmarks as well, please post your findings.
Thanks again.
scragar
12-05-2008, 03:27 PM
Can you provide any specifics on these "annoyances"? Are any/all of them known bugs in the PHP bug database (http://bugs.php.net/)? Any specific code examples of any of these bugs/annoyances?
PS: Please don't take the above as intended to be argumentative, I'd just like more info so that I can make a more informed evaluation/decision.
It's a little hard to explain, but using a built in MySQL function with the as keyword to call it by a field name that exists in the table causes it to fail, no error message, it just doesn't work.
Yes, you can just rename your choice of what you are calling it when pulling it using AS, but that's not the point, there is no logical reason for it to fail, yet it does.
It's a number of other little things going in the same way that are keeping me from using MySQLi myself just yet, when preparing to load information you need to specify the type of information you are passing in, yet for some reason the extension checks this against the table anyway(which is why you can't use ?'s as field or table names), so why the requirement to tell it what you are going to be using if it checks anyway?
As I said, it's stupid little things, but it doesn't make sense to me, so I'm going to hold off for a while, see if they clean it up a bit and explain the logic behind some of their decisions.
chazzy
12-05-2008, 05:46 PM
I found this, as a point of reference. It confirms what I assumed - the use of statements in mysqli is considerably faster than the plain querying in mysql.
http://www.johnjawed.com/benchmarks/
from a programming standpoint, the use of OOP styles, rather than procedural, seems more natural.