OK so I have gotten PDO to work in my feed creator script and I have noticed that there is a performance increase. It took me a while to get it to work a lot of referencing of php.net, but from all that referencing I came across a line of code that confused me and had no explaination all of you OO gurus out there could tell me why I had to do this bc I have no clue since I am extremly new to OO progaming.
Why do I have to do this?
// only select the columns you need, thus reducing the work the DBMS has to do
$sql = "SELECT title_art, description_art, date_art, idtop_art FROM blg_article_art";
$results = $db->prepare($sql);
$results->execute();
//print some stuff...
while ($row = $results->fetch(PDO::FETCH_ASSOC))
{
//print some more stuff...
}
and can't do this
// only select the columns you need, thus reducing the work the DBMS has to do
$sql = "SELECT title_art, description_art, date_art, idtop_art FROM blg_article_art";
$db->prepare($sql);
$db->execute();
//print some stuff..
while ($row = $db->fetch(PDO::FETCH_ASSOC))
{
//print some more stuff...
}