01.
<?php
02.
session_start();
03.
04.
mysql_connect(
"localhost"
,
"root"
,
"root"
);
05.
mysql_select_db(
"fun-d"
);
06.
07.
$Total = 0;
08.
$SumTotal = 0;
09.
10.
11.
$strOrder_id = mysql_insert_id();
12.
13.
for($i=0;$i<=(int)$_SESSION[
"intLine"
];$i++)
14.
{
15.
if($_SESSION[
"strProduct_id"
][$i] !=
""
)
16.
{
17.
$strSQL = "
18.
INSERT INTO order_detail (Order_id,Product_id,Qty)
19.
VALUES
20.
(
21.
mysql_query($strSQL) or die(mysql_error());
22.
}
23.
}
24.
25.
mysql_close();
26.
27.
session_destroy();
28.
29.
header(
"location:shop1.php?Order_id="
.$strOrder_id.
""
);
30.
?>