Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: mysql or mysqli

  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mysql or mysqli

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Mar 2006
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by printf View Post
    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

  • #5
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •