Tiffany B. Brown

A web log about web development and internet culture with frequent detours into other stuff.
Link dump: Thursday, June 15, 2006
Cristal vs. Hip-hop: Racism or anti-trash snobbery?

NYPHP Con: “Introduction to PDO”

PDO ships with PHP 5.1. You do not need to install via PECL

These are my notes from a presentation by Ilia Alshanetsky. This post may contain inaccuracies, typos, boo-boos, etc.

PDO stands for “PHP Data Objects Layer”: A data-access abstraction layer.

Why PDO?

Installation

Using PDO

Persistent Connections

Direct Query Execution using PDO

Problems with direct queries

Prepared statements

Retrieving information using PDO

Result Iteration - Fastest way of retrieving data through PDO

$res=$db->query("select * from users",PDO::FETCH_ASSOC);
foreach($res as $row){
   // returns an associated array
}

Lazy fetches

Related links

Share this entry:
  • Digg
  • Technorati
  • del.icio.us
  • Ma.gnolia
  • Mixx
  • NewsVine
  • Reddit
  • StumbleUpon
  • TailRank
  • Furl
  • Slashdot
  • Global Grind
  • YahooMyWeb
  • Facebook
  • Google
  • Live

2 comments

  1. Alaa Abu Al Haj said on 7 Dec 2006 at 3:29 am

    thanks a lot for these nice information,
    and i will be thankful if you add simple examples to make your introduction more powerful.

    Best Regards
    Alaa Abu-Al-Haj

  2. This wasn’t my presentation, so I don’t have any examples to offer.

previous post: Link dump: Thursday, June 15, 2006
next post: Cristal vs. Hip-hop: Racism or anti-trash snobbery?