Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Location
    Bird-in-Hand, Pennsylvania
    Posts
    62
    Plugin Contributions
    0

    Default You Have An Error in Your SQL Syntax with FEDEX

    Hello, when I add any product that has attributes (such as two sizes) to my cart, and with Fedex shipping enabled, I get this:
    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 ':44d38b46b1d3c53f1a372560a64762ea LIMIT 1' at line 1
    in:
    [SELECT products_length, products_width, products_height, products_ready_to_ship, product_is_always_free_shipping FROM products WHERE products_id = 12:44d38b46b1d3c53f1a372560a64762ea LIMIT 1]

    If I turn Fedex off, everything's Ok. The Fedex mod seems to be installed correctly, as we can get realtime quotes for non-attribute products and the meter id's are present in the admin.

    Anyone? Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    Bird-in-Hand, Pennsylvania
    Posts
    62
    Plugin Contributions
    0

    Default Re: You Have An Error in Your SQL Syntax with FEDEX

    Here's what my local html/sql tech had to say:
    ==========================
    Under modules/shipping there are two fedex files: fedexexpress.php and fedexground.php (and there would possibly be more for each fedex method you install). In those files there’s a function called “getDimensions()”. This function runs a call to $_SESSION[‘cart’]->get_products(). For some reason, products with attributes come back with an ID that has a colon and some other digits attached to it (like what you saw in the sql error).

    It seems like there would be a better way to handle this, but this solution works:

    Add the following code right after the line that says “foreach($products as $product){“

    $prid = $product['id'];

    if(stripos($prid, ':')) $prid = substr($product['id'],0,stripos($prid, ':'));

    The next line starts out with $sql = $db->Execute(… Find “$product[‘id’]” in that line and replace it with “$prid” (the variable created above.
    ==========================
    Seems to work. Fedex is operational.

 

 

Similar Threads

  1. You have an error in your SQL syntax???
    By Sjoukito in forum Basic Configuration
    Replies: 5
    Last Post: 7 Feb 2013, 12:06 AM
  2. 1064 - You have an error in your SQL syntax
    By jason.b in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 27 Aug 2012, 05:50 PM
  3. Replies: 1
    Last Post: 2 Dec 2011, 07:22 AM
  4. Replies: 1
    Last Post: 25 Aug 2011, 05:58 AM
  5. Replies: 8
    Last Post: 28 Jun 2011, 08:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg