...

View Full Version : mysql or mysqli



jussa
05-30-2007, 10:38 AM
hi,

i have read a few articles on this. but none that i read a really that conclusive.

im writing a mysql class. which extention should i use. mysql or mysqli?

is mysqli only in avaliable in php5? what are the differences between the two?

i know mysqli has in built character escaping. but other than that, it appears theres not much of a performance issue...

Thanks,
Justin

_Aerospace_Eng_
05-30-2007, 10:48 AM
Yes mysqli is only available in php5. From reading the manual you can now select a database using mysqli_connect to where before you had to use mysql_select_db('database') name. With mysqli_connect() you can also specify a port to be used when connection to mysql.

printf
05-30-2007, 12:35 PM
To me unless your using stored procedures, triggers I see no real benefit, plus mysqli_ is much slower than mysql_ when doing basic stuff, which is how most PHP developers use MySQL. But if your writing a class, the base class could define a set of principles and that base class could be extended to handle both API(s) so your queries could be run through what ever API that is available on the system your application is running on without the need to change how a query is executed within the class.

jussa
05-30-2007, 12:52 PM
To me unless your using stored procedures, triggers I see no real benefit, plus mysqli_ is much slower than mysql_ when doing basic stuff, which is how most PHP developers use MySQL. But if your writing a class, the base class could define a set of principles and that base class could be extended to handle both API(s) so your queries could be run through what ever API that is available on the system your application is running on without the need to change how a query is executed within the class.

thanks for the reply, both of you.

im hoping i can work out with my hosting to have a server with mysql 5 on it, for stored procs (im also a .net/sql server 2005 developer, and would love this functionality...)

i like the idea of using both, depending on what the system has avaliable. would you be able to point me in the direction of how i would be able to achieve this?

Thanks,
Justin

marek_mar
05-30-2007, 02:37 PM
You could look at http://www.codingforums.com/showthread.php?t=99042



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum