Instead of the above I would want to create an associative array of arrrays that
would hold contain $row… I intend to return the associative array to my view.
Could someone help me with the best way to do this?
If you want to use the array notation ( ) instead of object ( -> ) then use FETCH_ASSOC or FETCH_BOTH in place of FETCH_OBJ.
The example given might be a bit wayward as it is using ->fetch() to get a single row, yet it is looping through the results as if you had used ->fetchAll().