Click to See Complete Forum and Search --> : Lack of use: mysqli
chazzy
03-19-2006, 01:17 PM
Just wondering, how come it seems like almost no one takes advantage of the mysqli package? Since a lot of hosts are now up to 4.1.x, you might be able to do things better with your applications if you use it...
Discuss, I suppose.
LiLcRaZyFuZzY
03-19-2006, 03:44 PM
what advantage does it have?
chazzy
03-19-2006, 04:35 PM
It's object oriented, for one thing. Then again, is PHP really object oriented?
It's library is more extensive, too.
See:
http://php.net/manual/en/function.mysqli-affected-rows.php
Versus
http://php.net/manual/en/function.mysql-affected-rows.php
While those functions don't really matter, they're the first to fully show off the library given by MySQLi. It's designed for the newer MySQL databases, 4.1.x>=3, 5.0.x, 5.1.x so it would be easier to cross over.
NogDog
03-19-2006, 05:37 PM
Since most of the stuff I do in PHP is intended to run on web hosts which I have little to no control over, and since I want my scripts to be reasonably portable; I tend to avoid using anything that requires a non-default installation of PHP, and I'm under the (possibly incorrect) impression that the mysqli extension is not installed by default. (This is why I still usually avoid PHP5-only functions/features, too.)
bokeh
03-19-2006, 06:36 PM
This is why I still usually avoid PHP5-only functions/features, too.The trouble is though, the default build of PHP 4 doesn't always have equivelant functions. This certainly seems to be the case with the DOM functions.
chazzy
03-19-2006, 08:19 PM
Since most of the stuff I do in PHP is intended to run on web hosts which I have little to no control over, and since I want my scripts to be reasonably portable; I tend to avoid using anything that requires a non-default installation of PHP, and I'm under the (possibly incorrect) impression that the mysqli extension is not installed by default. (This is why I still usually avoid PHP5-only functions/features, too.)
Interesting approach. You know that the mysql extension was removed from the default release in PHP5, so you have to decide which you want to install, if any. So that means if you want a specific database connector for MySQL, you have to expect to need it installed.
The only issue I've seen with the improved (that's what the i means, how clever) extension is that it has a really odd sense of an object. You can't create a new mysqli object if it can't connect. This makes all of the error returning functions non-object oriented. Weird quirk, but whatever.