Jump to content

Entering data into database for Shopping Cart


leighhobson89

Recommended Posts

Hi, I have a question here.

 

Assuming all the variable names are spelt correctly etc, is there any reason why this wont insert the data into the database (the cart), yet it goes to URL shopping.php as its supposed to.  It was working, but i did one thing trying to fix another glitch and now it wont write the data in, i assume it will be something really simple.  (The variables collect data from a previous screen successfully and display it here, so its not that either, and the form has been closed correctly.)

 

Here's the code anyway...

 

echo"<input name='checkout' type='submit' value='Add to Cart!' onclick='mysql_query('INSERT INTO `lptCart` 		(`department`,`product`,`colour`,`size`,`quantity`,`totalprice`,`Remove`) 
VALUES(`$Row[department]`,`$Row2[product]`,`$Row3[colour]`,`$Row4[size]`,`$quantity`,`$totalprice`,`$remove`)') or die(mysql_error());'/>";

 

Hope some1 can help me! ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.