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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.