-
Hello, I have some putput from a query which I do not quite understand. $entries = $database->query('select see.id, see.name, see.location, see.lat, see.lon, data.temp, data.info, data.updated, data.lastaccess, data.website from see join data on see.id = data.see order by see.name asc')->fetchAll(); Gives me some weird results which contains both the column name as a key as well as an integer as a key.
I am not certain whether I did something wrong or this is an issue. Thanks and kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The The result is correct with both index and key by default. To get a different type of result, check out the parameters from the documentation. |
Beta Was this translation helpful? Give feedback.
The
query()
returnsPDOStatement
object, and you are calling itsfetchAll()
.The result is correct with both index and key by default.
To get a different type of result, check out the parameters from the documentation.
https://www.php.net/manual/en/pdostatement.fetchall.php