calumogg
12-21-2007, 06:32 PM
Hi, I have come across part of a shopping cart that I want to use, all I have is the functions the one below is just an example.
function delete_item($table, $session, $product) {
$query = "DELETE FROM $table WHERE session='$session' AND product='$product' ";
mysql_query($query);
}
But now I am stuck, I dont actually know how to use the functions! This is all the documentation that came with the code:
<?
include("shoppingcart.php");
$cart = new Cart;
$mysql_link = mysql_connect("localhost", "wwwrun", "");
$mysql_select_db("kmartShopper", $mysql_link) /* heh, use whatever database name you put the 2 tables under in place of kmartShopper */
?>
Please could someone post a example code that would use the delete_item function?
Thanks in advance for any help
function delete_item($table, $session, $product) {
$query = "DELETE FROM $table WHERE session='$session' AND product='$product' ";
mysql_query($query);
}
But now I am stuck, I dont actually know how to use the functions! This is all the documentation that came with the code:
<?
include("shoppingcart.php");
$cart = new Cart;
$mysql_link = mysql_connect("localhost", "wwwrun", "");
$mysql_select_db("kmartShopper", $mysql_link) /* heh, use whatever database name you put the 2 tables under in place of kmartShopper */
?>
Please could someone post a example code that would use the delete_item function?
Thanks in advance for any help