Jump to content

PDO vs Procedural


paulc8481

Recommended Posts

I have taken php in school and worked with MySQL procedural methods but now I have read a number of articles regarding PDO and its use across various platforms.  Is PDO that much better than procedural or is it overblown.  If some was to use the older procedural method would it be bad.  I would like some input regarding this before I begin so I make the right choice.

 

Thank you

 

Link to comment
Share on other sites

If you're talking about the mysql_* functions, they're hopelessly outdated and have been removed from PHP 7 (they still exist as deprecated functions in PHP 5). No current code should use them. One objective problem is that the old extension doesn't support prepared statements, making it impossible to securely pass values to queries.

 

The two modern alternatives are mysqli and PDO. mysqli is very similar to the old MySQL extension and even has a procedural interface. However, it's rather cumbersome and naturally limited to the MySQL database system. PDO is purely object-oriented, but it's well-designed and supports all current mainstream database systems, not just MySQL.

 

I generally recommend PDO. There are several good tutorials out there.

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.