So a snag I am hitting in using PDO MySQL is that if i run a query like so:
$db->pquery("SELECT `category_id`, `category_name` FROM `database_categorys` ORDER BY `category_name` ASC");
while ($category = $db->fetch())
{
}
Inside the while loop i cannot do another query or it will cancel out the previous query, is there a way to get around that?
This is my pquery btw:
// A plain query
public function pquery($sql)
{
$this->STH = $this->database->prepare($sql);
$this->counter++;
return $this->STH->execute();
}
And my fetch function:
public function fetch()
{
$this->STH->setFetchMode(PDO::FETCH_ASSOC);
return $this->STH->fetch();
}