Page 1 of 1

mysqli vs mysql

Posted: Sat Jul 28, 2007 7:20 pm
by Dave2000
Argh... as soon as I learn one thing I find another way I could do it better...

I just wrote a mysql database/class - now I discover mysqli. (Yeah i know I am a n00b - a better person would have know about mysqli in the first place.) Anyways, should I abandon my mysql class and use the built-in mysqli class??

Thanks

Shears

Posted: Sat Jul 28, 2007 9:27 pm
by califdon
I don't think I would do that, but maybe someone else may provide an argument for doing so. Disclaimer: Although I've developed a number of relatively simple MySQL databases, I'm nowhere near an expert.

Posted: Sun Jul 29, 2007 7:59 am
by feyd
There are minor differences between the two, but nothing really substantial.

Posted: Sun Jul 29, 2007 9:14 am
by nathanr
I think it's down to personal preference, as far as I'm aware, if you want to use cursors, prepared statements, or multiple result sets then you'll be needing mysqli :)

Posted: Sun Jul 29, 2007 12:44 pm
by AKA Panama Jack
Even thought Mysqli has been around a long time you will find many shared hosting companies don't have it enabled. So to be safe you should either stick with just Mysql. The otehr alternative is to support both with your class and perform a check to see if Mysqli is enabled and use it instead and if not drop back to Mysql.

Re: mysqli vs mysql

Posted: Sun Jul 29, 2007 4:16 pm
by timvw
Shears wrote:I just wrote a mysql database/class - now I discover Anyways, should I abandon my mysql class and use the built-in mysqli class??
What does mysqli offer you that you don't have in the mysql extension? And why do you need it?

(Btw, i would find it hard to believe that it would be hard to change the implementation from using mysqli instead of mysql)

Re: mysqli vs mysql

Posted: Sun Jul 29, 2007 6:11 pm
by Dave2000
timvw wrote:What does mysqli offer you that you don't have in the mysql extension? And why do you need it?
Nothing at the moment. I just heard stuff about it being faster/securer/better; and there may be in the future a time when I want to use some of it's extended functionality... It seems logical to me to use it if it's available. I guess about what Panama Jack said, it's similar to too few people using PHP5 :?

http://devzone.zend.com/node/view/id/686

Re: mysqli vs mysql

Posted: Mon Jul 30, 2007 4:26 pm
by nathanr
timvw wrote:What does mysqli offer you that you don't have in the mysql extension? And why do you need it?

a few posts back..
nathanr wrote:if you want to use cursors, prepared statements, or multiple result sets then you'll be needing mysqli :)

Posted: Wed Aug 01, 2007 5:35 am
by timvw
The point i was trying to make is that you shouldn't change something that works unless there is a need for it...

(Imho, updating, just to stay current, without a business need, is a waste of time/money)