Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Query using Session_id 1

Status
Not open for further replies.

WilliamMute

Programmer
Jan 4, 2006
117
Hi all,

I am trying to write a basic shopping cart script and seems to be loosing it in the process.

Basically, I use sessions, two tables ( product & basket).

I am now writting a query to display the content of the basket table belonging to a matching session id.

slq: $query_Recordset1 = "SELECT product_id, quantity, id FROM springrisecart WHERE session = $cart_id";

Note I have already assigned

<?php
if(!isset($HTTP_COOKIE_VARS['cart_id'])) {
$cart_id = md5(uniqid(rand()));
setcookie("cart_id", $cart_id, time() + 14400);
} else {
$cart_id = $HTTP_COOKIE_VARS['cart_id'];
}

?>



ERROR on Browser:
Unknown column '2bc2e65f7709880e5b8c0ac79df6f0ae' in 'where clause'



Any suggestions what is wrong Please?

Thanks so much
 
Thanks jpadie, dont know how I missed that! u're star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top