I am using the following coding it displays everything ok from the customer part of it. The problem I have is with the product part it displays and shows the 8 to 15 rows of product codes ids names descriptions etc. This is where i am stumped at a loss i want to submit it to another php script that inserts each individual product row and the 2 new values quantity and amount into a new table but insert them into one row on the new table. The second script i would usually use i have included an example under this 1st code. but i know it won't work in this case i do not know what to do the individual row values are all the same when they display on the 1st page? Is there a simple way of doing this i thought about creating the table when i registered a new customer and inserting product rows to that table as i add products to users but i always get back to the same problem which is the same as this one?
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<form name="form2" method="post" action="test.php" onsubmit="return v.exec()">
<?
$cid = mysql_real_escape_string($_GET['cid']);
$query = "select * from tblcustomerdetails where intCustomerID = '$cid'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$cid = $row["intCustomerID"];
?>
<tr>
<td><?print_r( $row['vcCCompanyName'])?></td><td align="left">Tel: <?print_r( $row['vcCDPhone'])?></td>
</tr>
<tr>
<td><?print_r( $row['vcCStreetNo'])?> <?print_r( $row['vcCStreet'])?></td><td align="left">Fax: <?print_r( $row['vcCFaxNo'])?></td>
</tr>
<tr>
<td><?print_r( $row['vcCCity'])?></td><td align="left">Email: <?print_r( $row['vcCEmail'])?></td>
</tr>
<tr>
<td><?print_r( $row['vcCState'])?></td><td> </td>
</tr>
<tr>
<td><?print_r( $row['vcCPostalCode'])?></td><td> </td>
</tr>
<tr>
<td><?print_r( $row['vcCCountry'])?></td><td> </td>
</tr>
</table>
<br />
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td> </td><td><b>Code</b></td><td><b>Name</b></td><td><b>Description</b></td><td><b>Price</b></td><td colspan="2" align="center"><b>Action</b></td>
</tr>
<?
$accountsql="select * from tblpricedetails where intCustomerID=$cid order by intProductID asc";
$tempdata=$DB_site->query($accountsql);
$count =$DB_site->num_rows($tempdata);
while($rowdata=$DB_site->fetch_array($tempdata))
{
$intPriceID = $row["intPriceID"];
$intProductID = $row["intProductID"];
$vcProductCode = $row["vcProductCode"];
$vcProductName = $row["vcProductName"];
$vcProductDescription = $row["vcProductDescription"];
?>
<tr>
<td class="accountsumb">
<?=$rowdata["intProductID"]?>
</td>
<td class="accountsume">
<?=$rowdata["vcProductCode"]?>
</td>
<td class="accountsumc">
<?=$rowdata["vcProductName"]?>
</td>
<td class="accountsumc">
<?=$rowdata["vcProductDescription"]?>
</td>
<td class="accountsumc">
<?=number_format($rowdata["ftAmount"],2,".",",");?>
</td>
<td class="accountsumc" align="right">
<input type="text" size="10" name="Quantity" />
</td>
<td class="accountsumc" align="center">
<input type="text" size="10" name="total" />
</td>
</tr>
<?
}
?>
<? if($count==0)
{
?>
<tr bgcolor="#EFEFEF" class="smallblack">
<td colspan="7" align="center" bgcolor="#EFEFEF" class="redtext">This user has no product data. </td>
</tr>
<?
}
?>
<tr>
<td colspan="7" align="center"><br />
<input name="submit" type="submit" class="button" value="Submit" />
</td>
</tr>
<tr>
<td colspan="7" align="center">
<input class="button" type="reset" name="reset" value="Reset" />
</td>
</tr>
</table>
</form>
submit code i am used to
<?PHP
include("checkadminlogin.php");
include("global/connection.php");
error_reporting(7);
if($count)
{for($i=0;$i<$count;$i++)
{
$insertsql ="insert into tblinvoicedetails (intCustomerID,vcProductCode,vcProductName,vcProductDescription,dtCreatedOn) values ('".addslashes($vcProductCode)."','".addslashes($vcProductName)."','".addslashes($vcProductDescription)."','".date("Y-m-d h:m:s")."')";
$DB_site->query($insertsql);
header("Location:ap.php");
exit;
}
?>
<script>
alert("Profile UPdated")
document.location.href="ginv.php"
</script>
Any pointers will be appreciated thanks