Hi there,
I have been trying to produce my own Ecommerce site using PHP. But I have hit a brick wall - when it comes to listing the products on screen this is fairly simple using an mySQL query:
$query = "SELECT $table_basket.PROD_ID, PROD_MODEL, PROD_PRICE, PROD_TYPE, QUANTITY
FROM $table_basket, $table_products, $table_users
WHERE $table_basket.PROD_ID = $table_products.PROD_ID
AND $table_basket.CUST_ID = $table_users.CUST_ID
AND $table_users.USERNAME = \"$User\"";
$result=mysql_query($query);
if (! $result) printf ("Error: %s<br>", mysql_error ());
for ($i = 0; $i < mysql_num_rows ($result); $i++) {
$row = mysql_fetch_row($result);
cho("<tr>");
for($j = 1 ; $j<4; $j++) {
if ($j==2) {
echo("<td><font size=2>£$row[$j]</font></td>");
}
else {
echo("<td><font size=2>$row[$j]</font></td>");
};
};
echo("<TD><INPUT TYPE=TEXT NAME=QUANTITY[");
echo($row[0]);
echo("] VALUE = \"");
echo($row[4]);
echo("\" SIZE=3></td><td><B>");
echo("£"); echo($row[2]*$row[4]);
$total = $total + $row[2]*$row[4];
echo("</td>");
};
This list the products in the shopping basket, but how do I get the same "For" loop to work within a Mail function...I have tried to no avail
Can anyone help?
Cheers
Brian