
July 5th, 2003, 05:46 AM
|
|
Junior Member
|
|
Join Date: Jun 2003
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Cannot "insert into" database
PHP Code:
<?php
include("db.php");
global $dbServer, $dbUser, $dbPass, $dbName;
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
mysql_select_db($cxn);
$result = mysql_query("select Max(orderId) As Buyer_Id from buyer");
$row = mysql_fetch_array($result);
$Get_Buyer_Id = $row['Buyer_Id'];
$result = mysql_query("select items.itemName, cart.qty from cart inner join items on cart.itemId
= items.itemId where cart.cookieId = '". GetCartId() . "' order by
items.itemName asc");
$row = mysql_fetch_array($result);
echo "Hello ".$HTTP_GET_VARS['Get_Name']."<br>";
echo "Your order is as bellow:<br>";
echo "Your order id is ".$Get_Buyer_Id."<br>";
do
{
echo $row['itemName']." = ".$row['qty']."<br>";
}
while($row = mysql_fetch_array($result));
echo "Total: ".$HTTP_GET_VARS['Get_Total'];
mysql_select_db($cxn);
$result = mysql_query ("Insert Into order Values (".$Get_Buyer_Id.", ".$row['itemName'].", ".$row['qty'].", ".$HTTP_GET_VARS['Get_Total'].")");
mysql_query("delete from cart where cart.cookieId = '". GetCartId() . "'");
?>
Hi.
The above script just run perfect for me, but i having a big problem on the script, it just not allow me to insert into the table call "order".
am i missing samething?
appreciate for any solution,
Thank you.
kelvin
|