For each result in MySQL query, push to array (complicated)
- by Dylan Taylor
Okay, here's what I'm trying to do. I am running a MySQL query for the most recent posts. For each of the returned rows, I need to push the ID of the row to an array, then within that ID in the array, I need to add more data from the rows. A multi-dimensional array.
Here's my code thus far.
$query = "SELECT * FROM posts ORDER BY id DESC LIMIT…