Using PDO in PHP

Using PDO in PHP

Ran across an excellent article today over at NetTuts. It is a perfect starter guide for the intermediate PHP programmer looking to get a good headstart on using PDO (PHP Date Objects) in PHP 5.1 or later. There are two things I would point out to anyone looking to implement PDO in PHP.

1. Make sure you obfuscate (hide) your variables and SQL calls by using prepared statements! This is a life saver and a necessity for any site exposed to the public. Failure to do so will lead (eventually) to a SQL injection which will compromise your database and therefore your site security.

2. Use re-usable classes for commonly used obects (like user info, cart info, etc) this will save you a TON of time and make your code much easier to debug and reuse again and again.

So…here you go check out Erik Wurzer’s post at nettuts.

Possibly related posts: (automatically generated)

Leave a Reply

You must be logged in to post a comment.