dimanche 1 mai 2016

fetch database data with singleton design pattern

I'm using singleton design pattern for connect to database.In below I run a query on my database and I want to fetch data from this query :

$db = Db::connect();
$query = $db->query("SELECT * FROM myTable");
while ($row = ???) {
// some code here ...
}

What should I write instead of ??? in my code ?

Aucun commentaire:

Enregistrer un commentaire