osCmax v2.5 User Manual
Results 1 to 4 of 4

osCMax-2.0RC2-update051112 1064 Error.

This is a discussion on osCMax-2.0RC2-update051112 1064 Error. within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; The code line below when applied from osCMax-2.0RC2-update051112 patch causes 1064 SQL error when you try to "copy to" duplicate ...

      
  1. #1
    New Member
    Join Date
    Mar 2004
    Posts
    11
    Rep Power
    0


    Default osCMax-2.0RC2-update051112 1064 Error.

    The code line below when applied from osCMax-2.0RC2-update051112 patch causes 1064 SQL error when you try to "copy to" duplicate in the catagory products page. If you omit it no problem occurs.


    Code:
    // LINE CHANGED: MS2 update 501112 - Added :(empty($product['products_date_available']) ? "null" : ...{some code}... ") . "
    // LINE MODED: Added "products_ship_price"
                tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_ship_price, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . $product['products_ship_price'] . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ". '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
                $dup_products_id = tep_db_insert_id();

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default RE: osCMax-2.0RC2-update051112 1064 Error.

    There was a syntax error. Changing the query to the following (line 36 will correct the problem:

    Code:
                tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_ship_price, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . $product['products_ship_price'] . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    New Member
    Join Date
    Mar 2004
    Posts
    11
    Rep Power
    0


    Default Re: RE: osCMax-2.0RC2-update051112 1064 Error.

    Original

    .....tep_db_input($product['products_price']) . "', '".......

    now(), '" . tep_db_input($product['products_date_available'])
    .....

    New

    .....tep_db_input($product['products_price']) . "', now(), "

    "null" : "'" . tep_db_input($product['products_date_available'])
    ......
    The new code which is part of the update patch causes a number of Mysql errors if implemented. When I revert to the old code everything works again? Not sure what this update is meant to do but if you attempt to COPY TO you will get Mysql errors if this code is present?

    Quote Originally Posted by msasek
    There was a syntax error. Changing the query to the following (line 36 will correct the problem:

    Code:
                tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_ship_price, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . $product['products_ship_price'] . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

  4. #4
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default RE: Re: RE: osCMax-2.0RC2-update051112 1064 Error.

    Use the code I posted as a fix. It corrects the issue.
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

Similar Threads

  1. Fatal error after intalling osCMax-2.0RC2-update051112 patch
    By ikhan42 in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 06-10-2006, 09:17 AM
  2. Is this the full program - osCMax-2.0RC2-update051112 p
    By ozstar in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 02-08-2006, 09:39 AM
  3. 2 osCMax-2.0RC2 issues
    By macfionn in forum osCMax v2 Features Discussion
    Replies: 7
    Last Post: 01-02-2006, 08:43 PM
  4. Security Patch osCMax 2.0RC2
    By warrenthewindmill in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 12-04-2005, 09:50 AM
  5. osCMax 2.0RC2 Security Patch/Update 051112
    By michael_s in forum Announcements
    Replies: 0
    Last Post: 11-27-2005, 09:12 AM

Bookmarks

Posting Permissions

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