Hi All
I was wondering if somebody could help me as this is driving me crazy.
I am trying to send an array from a mysql_fetch_array result to a seporate table. I have the following code:
include("config.php");
$result7 = mysql_query("SELECT * from order_total");
while($row = mysql_fetch_array($result7))
{
$test = array($row['item'].' '.$row['cost'].',');
foreach($test as $value) {
//$arr = array($value[0].$value[1].',');
}
echo $value;
mysql_query("UPDATE orders_complete SET ord_descr='$value' WHERE date='06/11/08' and time='13:33:53'")
or die(mysql_error());
}
the table currently holds customer orders i.e
9 Inch Seafarer Pizza £8.00
9 Inch Beef Eater Pizza £8.00
9 Inch Plus Special Pizza £8.00
15 Inch Vegetarian Pizza £12.00
the
echo $value
seems to echo ok the following to the screen:
9 Inch Seafarer Pizza 8.00,9 Inch Beef Eater Pizza 8.00,9 Inch Plus Special Pizza 8.00,15 Inch Vegetarian Pizza 12.00,
but when viewing the ammendments made to the row, it ONLY inserts the last record: in this case 15 Inch Vegetarian Pizza £12.00
I was wondering if anybody could help me understand what i am doing wrong?
Thanks