mysqli vs mysql

Discussion in 'PHP' started by SecureCP, Mar 19, 2010.

  1. #1
    Hello all,
    I'm relatively new to php. I was wondering what benefits and limits each yields. It seems like every book I've picked up leans toward using mysqli over plain mysql. Just wondering, and yes I could have googled, but I like to hear personal experiences.

    Thanks!
     
    SecureCP, Mar 19, 2010 IP
  2. Brad Proctor

    Brad Proctor Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mysqli is more secure than mysql. You don't need to use mysql_real_escape_string(); as it does this internally and also gives you more possibilities, room for improvements. I recently rewrote my database wrapper class from using mysql to mysqli. I use the procedural interface so the code is mostly the same.

    mysql is the older interface, whereas mysqli is newer takes care of a lot of the problems that were in the mysql.
     
    Brad Proctor, Mar 20, 2010 IP