Unable to get all entries of a table


#1

Hi, I am trying to pick a list with all entries from a db table by using
$sql = 'SELECT * FROM PREFIXowncollab_timetracker_clients'; return $this->findEntity($sql);.
But this throws following error:
Exception: {"Exception":"OCP\AppFramework\Db\MultipleObjectsReturnedException","Message":"Did not expect more than one result when executing: query \"SELECT * FROM PREFIXowncollab_timetracker_clients\"; parameters Array\n(\n)\n; limit \"\"; offset \"\"","Code":0,
What am I doing wrong?
Andy


#2

Is findentity really what you want to use?
You are selecting multiple values and need to process them

stmt = $this->db->prepareQuery($SQL);
$result = $stmt->execute(array(...));
while( $row = $result->fetchRow()) {....

Let me know...


#3

Could be so easy . . . findEntities did it. Maybe it has been too late.