PHP and MySQL

PHP5+ can work with a MySQL database using:

  1. MySQLi extension (the “i” stands for improved)
  2. PDO (PHP Data Objects)

PDO can work on 12 different databases
MySQLi only works on mySQL databases

Both are object-oriented, but MySQLi also offers a procedural API.

A great benefit of PDO is that it has an exception class to handle any problems that may occur in our database queries. If an exception is thrown within the try{ } block, the script stops executing and flows directly to the first catch(){ } block.

Why did I choose MySQLi? It has an API.

A side note: who even uses PHP?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s