SQL error occurred in the IFRAME page inside PHP
In making a shopping cart website.
I am in the home.php page right iframe a shopping cart, shopping_cart_form.php
Originally everything is good, I in home.php inside each product added a few text input what, in shopping_cart_form.php inside add a few sentence SQL.
But as soon as I add a little to the cart, the IFRAME will appear:
You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near "at line 1
I looked inside the shopping_cart_form.php and couldn't find anything wrong with SQL.
Later I replaced the shopping_cart_form.php with the normal code, unexpectedly also appeared wrong, before is good ah!
Home.php inside changed a few input, can affect the inside of the IFRAME?
<!--code Highlighting produced by Actipro Codehighlighter (freeware)-->//I added so many//this one is good, check the database display data is written in. $query = "INSERT into CART (username, dish_id, Dish_qty, Total_price, dest_id, shop_id) VALUES (' $username ', ' $dish _id ', ' $ Dish_qty ', ' $dish _total_price ', ' $dest _id ', ' $shop _id ');//The following two have errors? This page is so much SQL. $query = "SELECT * from DISH WHERE dish_id = ' $dish _global_id '"; $query = "INSERT to CART (username, dish_id, Dish_qty, total _price, dest_id, shop_id) VALUES (' $username ', ' $dish _global_id ', ' $dish _global_qty ', ' $dish _global_total ', ' $dest _id '
,'')";
------Solution--------------------
$query = "INSERT into CART (username, dish_id, Dish_qty, Total_price, dest_id, shop_id) VALUES (' $username ', ' $dish _global_ Id ', ' $dish _global_qty ', ' $dish _global_total ', ' $dest _id ', ') ';
shop_id The last field is "Is there a problem?"
------Solution--------------------
That's good enough.
What was the original? What is it now?
You didn't even explain!
Of course, you might be ready to answer my questions and find out where your problems are.