Forum Moderators: coopster

Message Too Old, No Replies

query help

         

n_amalyna

1:26 am on Jul 31, 2007 (gmt 0)

10+ Year Member



hyee.. if i'm combining 2 table.. how can i set where code='$id'? this is my code

<?
$aProduct = db_query(" SELECT p.product_desc,o.dt_order_product_price,o.dt_order_order_code from product_ms p inner join order_dt o
on o.dt_order_product_code=p.product_code");
if (!is_array($aProduct) )
{
echo "---";
}
else
{
foreach ($aProduct as $rowProduct)
{
echo $rowProduct[0];
}
}
?>
</select>

Habtom

5:45 am on Jul 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



at the end

SELECT p.product_desc, o.dt_order_product_price, o.dt_order_order_code from product_ms p inner join order_dt o
on o.dt_order_product_code = p.product_code WHERE code = '$id'

but check if it is p.code or o.code