I have two table : buy_temp & buy_detail, i need transfer data from buy_temp to buy_detail . For the first step i will get data from buy_temp like this :
$sid = $db->data("email", $user_session);
$sql = mysql_query("SELECT * FROM buy_temp WHERE id_session='$sid'");
while ($r=mysql_fetch_array($sql)) {
$cart[] = $r;
}
$j = count($cart);
All data where id_session='$sid' will collect and then with action submit data will save to buy_detail
for($i=0;$i<$j;$i++){
mysql_query("INSERT INTO buy_detail(id_orders, id_product, qty, option)
VALUES('$id_orders',{$cart[$i]['id_product']}, {$cart[$i]['qty']}, {$cart[$i]['option']})");}
But why i can't save for {$cart[$i]['option']}, when OPTION is varchar. ?