php - Mysql Fetch Array Foreach - Stack Overflow
Change it to, foreach($result_list as $row) { $productitems[] = array( 'id' => $row['id'], 'product' => $row['product'], 'price' => $row['price'] ); } Note: Please, don't use mysql_* functions in new code. They are no longer maintained and are officially ...