April 10, 2012

From Database language to PHP

Question by FGatlin

I need some help please. I have this from my database:

SELECT DISTINCT 
    iwi.item Item, ppd.item_des Des, iwi.qty_on_hand QOH, iwi.qty_allocated QA, 
    iwi.qty_on_order QOO, iwi.min_qty Minimum, MAX(ppm.expected_date)Exp_Date
FROM inv_warehouse_items iwi, pur_po_master ppm, pur_po_detail ppd)
WHERE IWI.CO = '100'
AND iwi.item_key = ppd.item_key
AND ppm.po_key = ppd.po_key
AND iwi.warehouse = '01'
AND iwi.item IN ('BXHP335',
'BXHP435',
'BXHP535',
'BXHP644',
'BXHP743',
'BXHP965',
'BXHP10741',
'BXHP10748',
'BXHP1253',
'BXHP1257',
'BXHP121210',
'BXHP151410',
'BXHP16114',
'BXHP181411',
'BXHP241612',
'BX1195',
'BX6636',
'BXHP201512',
'BXHP1949',
'BXHP2015',
'BXHP201515',
'BXHP351011',
'BXHP241814',
'BXHP2257',
'BXHP1824')

GROUP BY iwi.item, iwi.qty_on_hand, iwi.qty_allocated, iwi.qty_on_order, 
     iwi.min_qty, ppd.item_des
ORDER BY iwi.item"

And I need it to print out with php.

Answer by Starx

May be like this

$query = "...";
$result = $mysqli_query($db, $query);
while($row = mysqli_fetch_assoc($result)) {
    print_r($row);
}

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!