2012-04-10 11 views
-3

Ich brauche bitte etwas Hilfe. Ich habe das aus meiner Datenbank:Von Datenbank-Sprache zu PHP

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" 

Und ich brauche es mit php auszudrucken.

Antwort

0

wie diese

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

Warum nicht PDO verwendet werden darf? Besser, den richtigen Weg zu beginnen, als alles neu lernen zu müssen. Zumindest ist das meine Meinung. – tcole

+0

@tcole, Wenn OP grundlegend ist, dann wäre es besser, wenn er der progressiven Methode folgt. – Starx

+0

@tcole er weiß mysql, nicht in PHP drucken –