PHP Data Objects (PDO)

PDO, where have you been all of my life.

Link: TutsPlus - Why you should be using PHPs PDO for database access

Link: Plus2Net - PHP PDO Fetch row from Table

This Plus2Net site has some real life examples. I found this more useful than other sites which explain the technology.

Link: TutsPlus - PHP Database Access: Are You Doing It Correctly?

#Counting results
if($result->fetchColumn() > 0) {
echo "Records found";
}else{
echo "No records found";
}

#Counting deleted rows
$count = $result->rowCount();

#Displaying results
if ($data = $stmt->fetch()) {
    do {
        echo $data["model"];
    } while ($data = $stmt->fetch());
} else {
    echo "No results found";
}