/**
* @return mixed
*/
public function getAll()
{
return $this->getLic();
}
/**
* @return mixed
*/
private function getLic()
{
try {
$conn = $this->db->getPDO()->prepare("SELECT * FROM table");
$conn->execute();
$query = $conn->fetch(\PDO::FETCH_ASSOC);
} catch (\PDOException $exception) {
throw new \PDOException($exception->getMessage());
}
echo json_encode($query, JSON_OBJECT_AS_ARRAY);
return $query;
}
结果应为:
{{11:1, 11:1, 11:1}, {12:2, 22:2, 32:2,}, {13:3, 23:3, 33:3}}
但它返回:
{11:1, 11:1, 11:1}