Forum Moderators: coopster

Message Too Old, No Replies

pls help. newbie here.

         

n_amalyna

3:44 am on Jul 26, 2007 (gmt 0)

10+ Year Member



hye,

i got this prob here. i'm trying to show my data but i cant. can someone help me out to see where's my mistake?

<form action="customers_view.php" method="get">
<?
$id = $_GET['id'];
$aCustomer = db_query(" SELECT * FROM customer_ms WHERE customer_code = '".$id."'");
if (!is_array($aCustomer) )
{
echo "<option value=''>no Customer details available</option>";
}
else
{
foreach ($aCustomer as $row)
{
?>

<tr valign="top">
<td colspan="2"><h5>Order</h5></td>
</tr>
<tr valign="top">
<td width="200" align="right"><h5>Receipt Number : </h5></td>
<td width="20"></td>
<td>
<?
$query="SELECT * FROM order_ms WHERE order_code='". $HTTP_POST_VARS['$id']."'";
$result=db_query($query);
if($result)
{
foreach ($result as $rowResult)
{
?>
<textarea name="receiptnumber" rows="8" cols="40" readonly="true" class="table-txt"> <? echo $rowResult['order_code'];?></textarea>
<input type="hidden" name="receiptnumber" value="<? echo $rowResult['order_code'];?>"><?
}
}
}
}
?>
</td>
</tr>

what i need to do is the receipt i hve to take it from other table in db.. thank you in advance!

Habtom

5:02 am on Jul 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1. Use $_POST or $_REQUEST instead of $HTTP_POST_VARS
2. The function db_query is it included.
I am not quite sure what you are trying to achieve here:
$query="SELECT * FROM order_ms WHERE order_code='". $HTTP_POST_VARS['$id']."'";

If you are getting the order_code from the top query, you should put it as an input on this statement.

Hab