I make a little modification.
// Make sure the token available.
$query = "SELECT * FROM customer_bank WHERE token_id = '$t' AND account_no = '$aa' ";
$result = @mysql_query ($query);
if ($result) {
$data = "SELECT itemId, price, qty FROM cart ";
$result1 = @mysql_query($data) or die (mysql_error());
while($row = mysql_fetch_row($result1)) {
$comp = "SELECT COUNT (*) FROM cart ";
$comparison = @mysql_query($data) or die (mysql_error());
$itemId = $row['itemId']; // line 93
$price = $row['price']; // line 94
$qty = $row['qty']; // line 95
$cartId = $row['cartId']; // line 96
if ($comparison == "1") {
$query1 = "INSERT INTO view (itemId, price, qty, cartId) VALUES ('$itemId','$price','$qty','$cartId' )";
$result2 = mysql_query($query1) or die(mysql_error());// Run the query.
if ($result2) {
$insert = "UPDATE view SET account_no = '$aa', token_id = '$t', name = '$n', address = '$ad', state = '$s', country = '$c' WHERE cartId = '$cartId'";
$result_insert = mysql_query ($insert) or die(mysql_error());
// Successful add the new customer.
echo '<h3>Successful the transaction</h3>';
include ('includes/header_bank.html');
exit();
} else {
echo '<p><font color="red" size="+1">Cannot update to the database</font></p>';
}
} else if ($comparison == "2"){
$query2 = "INSERT INTO view (itemId, price, qty, cartId) VALUES ('$itemId','$price','$qty','$cartId' )";
$result3 = mysql_query($query2) or die(mysql_error());// Run the query.
if ($result3) {
$insert1 = "UPDATE view SET account_no = '$aa', token_id = '$t', name = '$n', address = '$ad', state = '$s', country = '$c' WHERE cartId = '$cartId'";
$result_insert1 = mysql_query ($insert1) or die(mysql_error());
} else {
echo '<p><font color="red" size="+1">Cannot update to the database</font></p>';
}
$query3 = "INSERT INTO view (itemId, price, qty, cartId) VALUES ('$itemId','$price','$qty','$cartId' )";
$result4 = mysql_query($query3) or die(mysql_error());// Run the query.
if ($result4) {
$insert2 = "UPDATE view SET account_no = '$aa', token_id = '$t', name = '$n', address = '$ad', state = '$s', country = '$c' WHERE cartId = '$cartId'";
$result_insert2 = mysql_query ($insert2) or die(mysql_error());
// Successful add the new customer.
echo '<h3>Successful the transaction</h3>';
include ('includes/header_bank.html');
exit();
} else {
echo '<p><font color="red" size="+1">Cannot update to the database</font></p>';
It make this error
Notice: Undefined index: itemId in C:\Program Files\Apache Group\Apache2\htdocs\change_checkout.php on line 93
Notice: Undefined index: price in C:\Program Files\Apache Group\Apache2\htdocs\change_checkout.php on line 94
Notice: Undefined index: qty in C:\Program Files\Apache Group\Apache2\htdocs\change_checkout.php on line 95
Notice: Undefined index: cartId in C:\Program Files\Apache Group\Apache2\htdocs\change_checkout.php on line 96
can you please help me to solve this problem? I really appreciated your help?