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! ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.