I'm using PDO's fetch to return data from two tables (orders and order_items).
The issue is I would like all the order_item row data to be nested as arrays inside each order data row.
Whilst looping through the rows is it possible to do the following?
$variable = $row[tablename.columnname]
I've tried this with and without specifying an alias for in my query (SELECT * FROM orders as orders WHERE ...etc..)
and I'm getting an 'Notice: Undefined index:'
error. Any ideas?
EDIT - THIS QUESTION IS DIFFERENT