i have one sql query like this
SELECT wp_woocommerce_order_items.order_item_name, wp_woocommerce_order_itemmeta.meta_value FROM wp_woocommerce_order_items INNER JOIN wp_woocommerce_order_itemmeta ON wp_woocommerce_order_items.order_item_id=wp_woocommerce_order_itemmeta.order_item_id WHERE wp_woocommerce_order_items.order_item_type = 'line_item' AND wp_woocommerce_order_itemmeta.meta_key='_qty' AND wp_woocommerce_order_items.order_id=1477
Now this query gives me two results like this
order_item_name meta_value
Handicap Accessible Porta Potty 1
Sani Stand Handwashing Station 1
and i want to push this into array with key.
i tried this code for push
while ($row2 = mysql_fetch_array($item_name)) {
$order_items['name'] = $row2['order_item_name'];
$order_items['quantity'] = $row2['meta_value'];
}
but above code push only one element. Please help
array_push(or, more simply,[]) and see if by some miracle writing the right code makes it work :p