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
  1. #1
    New Coder
    Join Date
    Dec 2010
    Posts
    61
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Question about MSQL vs MYSQLi

    I have been testing some code with MYSQLi and getting strange results!

    Is MYSQLi just improved code or is it a seperate application?

    If so, can MYSQLi code be used in with MYSQL 5.1.36 without any additional configuration?

    And last, is it necessary to update MYSQL applications to MYSQLi

    Sorry about the drill - but been trying to get the scoop on this...

    Thanks

  • #2
    Regular Coder
    Join Date
    Nov 2009
    Location
    Florida United States
    Posts
    105
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by CloudWriter View Post
    I have been testing some code with MYSQLi and getting strange results!

    Is MYSQLi just improved code or is it a seperate application?

    If so, can MYSQLi code be used in with MYSQL 5.1.36 without any additional configuration?

    And last, is it necessary to update MYSQL applications to MYSQLi

    Sorry about the drill - but been trying to get the scoop on this...

    Thanks
    Its improved code.
    Mysqli supports all 5.0 functions and is supposedly a little faster. It wouldn't hurt to update your apps, but I don't think its necessary
    New Coder!!!!

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    The mysqli PHP extension provides object-oriented classes and functions so there's one advantage. There is also additional functionality. Your PHP instance does need to be compiled with the mysqli option so there may be some configuration to get it working.

    I've used both mysql and mysqli extensions and really I can't see much point in moving to mysqli, other than it will be supported going forward. Of course, if you need to use the additional features, such as transactions or prepared queries, you'll need to use mysqli. Retrofitting mysqli into existing mysql code is a waste of time and would likely introduce bugs.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Agreed, unless you've always used an interfaced abstract to handle your database operations, I wouldn't switch over either. MySQL is one of those library's that PHP will (probably) never let die off. And even when it does, I'm sure you'll still be able to get the dll or so's for it and compile it back in yourself.
    Eventually you'll want to switch, but unless you're writing something new than I wouldn't bother converting either. Its a heck of a lot of work to change hard coded mysql_query calls into the new mysqli (hence why I suggest only changing it if you already have an abstraction layer). If you are writing new, go with either the MySQLi if you know its only going to be used for MySQL, or PDO if you want to expand for the future (PDO should be a little slower than MySQLi for MySQL control since its an abstraction, but PDO is generic so can be used in any database type that has a PDO driver available for it making it more reusable overall).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    New Coder
    Join Date
    Dec 2010
    Posts
    61
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Thanks for answering, and your right about Bugs!
    I made a side copy with one of my aps just to see what the differences are, I was chasing bugs like dominos.. At this point I don't think the benefit from a re-write is worth investing the time....

    The reason I was considering this was to start working with prepared queries.. And future consideration..

    I agree MYSQL will probably be around forever so why sweat it..

    chow!


  •  

    Posting Permissions

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