简体   繁体   中英

Drupal Shopping cart sql error

Keep getting an error within the drupal log and do not under stand why. Can someone help me out? FYI I have a shopping cart on the website. Pipettes.com. I've also attached a screenshot

Any help is appreciated. Thanks!

Message error

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 '' at line 7 query: SELECT id , price FROM wb_uc_cart_items WHERE cart_id = '00df18eef923efe7bc180f0307e713e4' AND snid = 31469 AND status = 'new' AND discounted = 'yes' ORDER BY price ASC LIMIT in /mnt/ebs/apache2/vhosts/pipettes.com/html/sites/all/modules/indigo_import/indigo_import.module on line 623.

indigo_import.module on line 623

621         $sql_updates = array();
622
623         $result = db_query($sql);
624         while ($row = db_fetch_object($result)) {
625
626                 $sql_updates[] = "UPDATE {wb_uc_cart_items}
627                 SET `status` = 'd'
628                 WHERE `id` = " . $row->id . " AND `discounted` = 'yes' AND `status` = 'new' LIMIT $s_discount_qty;";
629                 $dx++;
630
631                 if($snode->field_discounted_prices[0]['value']) {
632                         $this_total_discount += ($row->price - $snode->field_discounted_prices[0]['value']);
633                 } elseif($snode->field_discounted_percentage[0]['value']) {
634                         $this_total_discount += (($snode->field_discounted_percentage[0]['value'] / 100) * $row->price);
635                 }
636
637         }

Drupal日志中的错误的屏幕截图

What's the value of $s_discount_qty? It appears that the SQL statement in your log has a LIMIT clause without a following value. Are you able to execute the SQL statement via the mysql command line interface? IE: is it valid?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM