#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0

    Mysql deprecation


    Working on php 5+ and mysql5+. I intend to start using mysqli and OOP as soon as I can learn it. My question is how much time do I have before making the change? And, will I have to eventually have to rewrite projects that used mysql? I've been digging around and can't find out if Mysqli is going to replace mysql or just work alongside it as an option. If not, how long do I have to learn all this? Thank You
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2008
    Posts
    1,928
    Rep Power
    378
    Whatever its merits, I can't see OOP completely replacing procedural code any time soon.

    However, the 'mysql' method is, as you suggest, slowly being superseded by alternative methods of PDO and MySQLi.

    These methods are more secure than the traditional method, with (mostly) negligible effects on performance.

    To my understanding, characteristics of each are as follows:

    MySQLi
    - suitable for both OOP and procedural environments
    - MySQLi is tied to MySQL
    - very similar usage to the traditional mysql method

    PDO
    - suitable for OOP
    - not wedded to any particular SQL engine

    Others will of course come to a different conclusion, but I make that 2-1 (or 3-2) in MySQLi's favour.

    So you don't need to rush to learn OOP - but that's no reason not to start!
  4. #3
  5. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7170
    The PHP-MySQL API will be removed some day, but not soon. However, it's also no longer being updated, so any features it doesn't support now will never be supported (async. queries, prepared statements, stored procedures, multi-queries, etc.) and any new featured that are added to MySQL won't be supported ever. So for this reason, all new code should use MySQLi or PDO.

    What will likely happen, is that in 5-10 years the MySQL extension will become disabled by default in PHP. Then in another 10-20 years web hosts will stop installing it.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0
    Thank you for your thoughtful replies

IMN logo majestic logo threadwatch logo seochat tools logo