mysqli func param order

php.internals

Juergen Mueller

22 years ago
hi, I'am a little astonished concerning the modify function parameter order. mysqli_query ( object link, string query [, int resultmode]) for example expect the object link after the sql query. in the old ext/mysql it is completly reversed. I think this is bad for a possible migration from ext/mysql to ext/mysqli. is it possible to change this before release mysqli as stable? best regards juergen
-- +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++ 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz

Derick Rethans

22 years ago
On Wed, 3 Mar 2004, Juergen Mueller wrote:
> hi, > > I'am a little astonished concerning the modify function parameter order. > mysqli_query ( object link, string query [, int resultmode]) for example expect > the object link after the sql query. in the old ext/mysql it is completly > reversed. I think this is bad for a possible migration from ext/mysql to > ext/mysqli. > > is it possible to change this before release mysqli as stable?
Nope, this is the better thing as the link is always required anyway and it's more logical to do it like this as most other DB and other extensions what their object/resource as first parameter. Derick

Juergen Mueller

22 years ago
> Nope, this is the better thing as the link is always required anyway and > it's more logical to do it like this as most other DB and other > extensions what their object/resource as first parameter.
okay you're right! but it increased the migration process from ext/mysql to ext/mysqli in my opinion. best regards juergen
-- +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++ 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz

Lukas Smith

22 years ago
Juergen Mueller wrote:
>>Nope, this is the better thing as the link is always required anyway and >>it's more logical to do it like this as most other DB and other >>extensions what their object/resource as first parameter. > > > okay you're right! > but it increased the migration process from ext/mysql to ext/mysqli in my > opinion.
mysqli was created exactly, besides other reasons, to fix these kinds of issues and therefore break BC. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

Adam Maccabee Trachtenberg

22 years ago
On Wed, 3 Mar 2004, Juergen Mueller wrote:
> okay you're right! > but it increased the migration process from ext/mysql to ext/mysqli in my > opinion.
Having spent some time over the last few weeks investigating ext/mysqli, I can say that the migration process is definitely non-trivial if you're not already using some form of a database abstraction layer. It's not complex, but it's a bunch of work to reorder all the function parameters, especially since some functions have been deprecated and others reworked. Alternatively, John Coggelshall has a compatability layer here: http://www.coggeshall.org/show_source.php?filename=mysql2mysqli.php It looks like it does a pretty good job mapping from ext/mysql to ext/mysqli, but I haven't tried it myself. I've only read the source. -adam
-- adam@trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today!

Georg Richter

22 years ago
> hi, > > I'am a little astonished concerning the modify function parameter order. > mysqli_query ( object link, string query [, int resultmode]) for example > expect the object link after the sql query. in the old ext/mysql it is > completly reversed. I think this is bad for a possible migration from > ext/mysql to ext/mysqli. > > is it possible to change this before release mysqli as stable?
No, why do you want to do so? You will run in exactly the same problems as in ext/mysql: It will never be possible to add an additional parameter in future versions when mysqli api changes without breaking BC. Also using a default link is bad if you need more than one connection. Georg