I'm trying to figure out if I'm able to do a while loop inside an array
while($row = $retail -> fetch(PDO::FETCH_ASSOC)){
$json['data'][] = array(
'id'=>$row['idretailers'],
"category"=>$row['category'],
"headline"=>$row['headline'],
'price'=> array ("full_price" => $row['price']),
'description'=>$row['description'],
"comments" => array(
while($row_c = $comments -> fetch(PDO::FETCH_ASSOC)){
// more items
})
);
}
There's a while loop within the comments, is that possible?
Thanks!