...

View Full Version : Question about MSQL vs MYSQLi



CloudWriter
01-04-2011, 06:23 PM
I have been testing some code with MYSQLi and getting strange results!

Is MYSQLi just improved code or is it a seperate application?

If so, can MYSQLi code be used in with MYSQL 5.1.36 without any additional configuration?

And last, is it necessary to update MYSQL applications to MYSQLi

Sorry about the drill - but been trying to get the scoop on this...

Thanks

calebandchels
01-04-2011, 06:39 PM
I have been testing some code with MYSQLi and getting strange results!

Is MYSQLi just improved code or is it a seperate application?

If so, can MYSQLi code be used in with MYSQL 5.1.36 without any additional configuration?

And last, is it necessary to update MYSQL applications to MYSQLi

Sorry about the drill - but been trying to get the scoop on this...

Thanks
Its improved code.
Mysqli supports all 5.0 functions and is supposedly a little faster. It wouldn't hurt to update your apps, but I don't think its necessary

Fumigator
01-04-2011, 08:14 PM
The mysqli PHP extension provides object-oriented classes and functions so there's one advantage. There is also additional functionality. Your PHP instance does need to be compiled with the mysqli option so there may be some configuration to get it working.

I've used both mysql and mysqli extensions and really I can't see much point in moving to mysqli, other than it will be supported going forward. Of course, if you need to use the additional features, such as transactions or prepared queries, you'll need to use mysqli. Retrofitting mysqli into existing mysql code is a waste of time and would likely introduce bugs.

Fou-Lu
01-04-2011, 08:28 PM
Agreed, unless you've always used an interfaced abstract to handle your database operations, I wouldn't switch over either. MySQL is one of those library's that PHP will (probably) never let die off. And even when it does, I'm sure you'll still be able to get the dll or so's for it and compile it back in yourself.
Eventually you'll want to switch, but unless you're writing something new than I wouldn't bother converting either. Its a heck of a lot of work to change hard coded mysql_query calls into the new mysqli (hence why I suggest only changing it if you already have an abstraction layer). If you are writing new, go with either the MySQLi if you know its only going to be used for MySQL, or PDO if you want to expand for the future (PDO should be a little slower than MySQLi for MySQL control since its an abstraction, but PDO is generic so can be used in any database type that has a PDO driver available for it making it more reusable overall).

CloudWriter
01-04-2011, 09:14 PM
Thanks for answering, and your right about Bugs!
I made a side copy with one of my aps just to see what the differences are, I was chasing bugs like dominos.. At this point I don't think the benefit from a re-write is worth investing the time....

The reason I was considering this was to start working with prepared queries.. And future consideration..

I agree MYSQL will probably be around forever so why sweat it..

chow!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum