catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

Using $database->query($sql)->fechAll() returns column names and column iDs #1023

Closed esferium closed 2 years ago

esferium commented 2 years ago

Information

Describe the Problem

Using a sql statement in $database->query("select ...")->fechAll returns json object, with the names of the columns, but also with the id of the column.

{ "title": "title example", "0": "title example"}

Expected output { "title": "title example" }

esferium commented 2 years ago

$database->query("select...")->fechAll (2) $database->query("select...")->fechAll (PDO::FETCH_ASSOC)

https://www.php.net/manual/es/pdostatement.fetchall.php