Jump to content

mysql class vs mysqli class for frameworks.


bogdaniel

Wich one is better for a php framework to use ?   

4 members have voted

  1. 1. Wich one is better for a php framework to use ?

    • MySQLI Class
      1
    • Build your own mysql class
      3


Recommended Posts

mysqli is recommended extension to use with MySQL 4.1 and higher. So unless you need to connect to older versions, there's no reason to use mysql extension.

Even if you build your own class, you should base it on mysqli not mysql.

PDO :D?

 

Only if you're actually going to create code, that will work with all, or most supported databases. If you use PDO, and then use MySQL specific functions and statements, there's no point.

 

Well I didn't see him specify that, so I was just adding my 2 cents. Even if you use PDO_MYSQL it would be easier to switch to something like mssql than if you used mysqli.

If you just need some custom functions and things like query logging, why create your own class, having to create all the basic methods like query, fetch_assoc, error, when you can just create a class that extends MySQLi. Then all the methods are available, you can add whatever you want, and you can overide whatever you want, e.g. for doing query logging.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.