Zen Cart Logo
Forums / All Other Contributions/Addons / 1064 You have an error in your SQL syntax

1064 You have an error in your SQL syntax

Locked

Views: 849

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
14 Nov 2010, 12:43 AM
#1
snagroot avatar

snagroot

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

1064 You have an error in your SQL syntax

Hello,

I am getting the following message on my checkout_success page:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 5
in:
[UPDATE orders SET dropdown = '', gift_message = '' WHERE orders_id = LIMIT 1]

So I opened class.drop_down.php and I am not sure how I should change this code to fix the SQL error:

===================
// get the value of the selected dropdown
$dropdown = zen_db_input($_SESSION['dropdown']);
$gift_message = zen_db_input($_SESSION['gift-message']);

  // add selected dropdown option to the orders table
  $db->Execute("UPDATE  " . TABLE_ORDERS . "
                SET dropdown = '" . $dropdown . "',
                    gift_message = '" . $gift_message . "'
                WHERE orders_id = " . $orders_id . "
                LIMIT 1");
  
  // unset the dropdown session
  unset($_SESSION['dropdown']);
  unset($_SESSION['gift-message']);

===================

Please can someone help? :blink: