New here? Read Greetings Earthling!

Your PHP DB weapon of choice: MySQL or MySQLi?

These past two days I've ported 90% of my PHP library from use of old-school mysql to mysqli. I still have a bit to update.

Wrote a completely new mysqli framework with default connection [link] capability [removal of first mandatory mysqli parameter and allow for a global default one used as last parameter] and I will no longer use mysql_ inside my code.

My question to you is: What do you use: MySQL_ functions of mysqli classes/mysqli_ functions?
PLEASE ANSWER IN THE COMMENT FORM!

PS: I plan to release some scripts that will also need to interact with the database. I want to know if they will need to work with both or if you are 'new-school'... unlike me.

Category: MySQL, PHP
Tagged:

5 Responses

  1. MySQLi all the way. The inclusion of transactional support was what sealed the deal for me.

  2. You are ahead of me on this curve. What is the difference, why should I care and am I going to be doing a lot of Googling tonight now… :P

    Short answer: MySQL but ignorant of MySQLi.

    p.s. I’m surprised that YOU, of all people, aren’t using some sort of homegrown DAO or DA framework. I’m not but I’m not as advanced as you.

    • :) I like good stuff and MySQL is gr8. No need to make my own DB.

      Main difference between mysql and mysqli is mysqli is object oriented. And the procedural version of mysqli_ functions have the link parameter in front. This way there’s no default conection anymore. To update code that relies on default connections to specific connections is a PITA (but I’m over this already).

      MySQLi is the new lib PHP suggests we should use in new PHP versions.
      And it has transactions hardcoded even if same code is available by mysql calls directly.

  3. No, no, not a DB, a Database access layer. Rolling up your db functions into a class/classes and having all the back-end abstracted in your code.

    I’ve been reading this dude and thinking about modifying his.

    http://www.tonymarston.net/php-mysql/databaseobjects.html
    and
    http://www.tonymarston.net/php-mysql/databaseobjects2.html

    • Oh … I have that :) But it’s a different thing.

      But I work in a totally different way with databases from this guy’s wrapper.
      Interesting though. I’ll look into it.