Updating the Quantity of an Item in a Shopper's Basket
Introduction.
This page will be a fairly simple processing script that deletes an item
based on which button is pushed.
The following PHP page should be called update_quantity.php and it should be uploaded to your firefox website. |
<html> <!-- update_quantity.php - updating the quantity of an item in a shopper's basket --> <?php include("includes/connection_config.php"); // obtaining the id of the basket item the shopper wants to update $id_basket_item = $_REQUEST["txt_id_basket_item"]; // connecting to the database on battcave.com $link = mysql_connect($host, $user, $password); // now we need to get all the basic info on the item // in order to delete it from the basket_item table $query_string = "UPDATE basket_item SET item_quantity = $txt_quantity WHERE id_basket_item = $id_basket_item"; mysql_db_query($db_name, $query_string, $link); mysql_close($link); header("location:basket.php"); ?> </body> </html> |
We now give some discussion of the code.
|