Home > Net >  SQLite Database only returns first Row in PHP (Even with a Loop!)
SQLite Database only returns first Row in PHP (Even with a Loop!)

Time:08-28

I try to get all of my Data out of a SQLite Database.

This is my Database:

ID, Name,      Points
 3, Christian, 50
 1, Jannik,    200
 2, Lena,      50

This is the PHP-Code:

$res = $this->db->query("SELECT * FROM player");
while($row = $res->fetchArray(SQLITE3_ASSOC) ) {
    echo $row['name'];
}

But in the Frontend it echos out only the Row where the ID is equal to 1. In this case the name "Jannik"

Thank you!

CodePudding user response:

No code problem. It was the DB cache

  • Related