testQuery() is the method I use to get all rows from table CATEGORIES
public function __construct()
{
self::$tdb = Database::getConnection();
}
#mock quer
Fetch does indeed pull the data from the database one at a time, but you need to iterate through the rows until you have all the data.
You might want to pop this into a loop to get all the data:
$stmtAA->fetch(PDO::FETCH_ASSOC);
Something like this should do the trick:
while($row=$this->prepared->fetch(PDO::FETCH_ASSOC))
{
$this->ID=$row['id'];
$something=$row['something'];
}
Depending on if you are populating variables or have the code within an object.