Hi, Im building a cart everything is sweet but i need to be able to add values returned from a mysql query in a while loop.
if($id and $si and $quan)
{
// adds extra item to arrays
$purchase[] = $id;
$size[] = $si;
// queries arrays and returns the values
for ($i = 0; $i < count($size); $i++)
{
// connects to db and queries info required for each value in arrays.
$link_id = db_connect("iiwii");
$query = "select * from gallery where id='$purchase[$i]'";
$result = mysql_query($query);
while($myrow = mysql_fetch_row($result))
{
// sets variables for mysql results returned
$product = $myrow[2];
$desc = $myrow[3];
$price = $myrow[4];
}
echo "<tr><td>$product</td>
<td>$desc</td>
<td>$size[$i]</td>
<td><select size=\"1\" name=\"quan\">
<option>$quantity</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select></form></td>
<td>£$price</td></tr>";
}
}
The results come into columns like this.
| Product | Desc | Size | Quant | Price |
| Product | Desc | Size | Quant | Price |
| Product | Desc | Size | Quant | Price |
| Product | Desc | Size | Quant | Price |
| Product | Desc | Size | Quant | Price |
********************************| Total Price|
I need to add the $price variable returned
to itself for each value returned...
please help