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

Need Some help.

This is a discussion on Need Some help. within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; Hello, I have installed AABox.com osCMax V1.5.5. Everything is working fine but i get the following error when ever i ...

      
  1. #1
    Lurker
    Join Date
    Apr 2005
    Posts
    2
    Rep Power
    0


    Default Need Some help.

    Hello,

    I have installed AABox.com osCMax V1.5.5. Everything is working fine but i get the following error when ever i try to access Specials under Catalog in Admin section.

    Code:
    Specials  
      
    Products Products Price Status Action  
    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 '-10, 10' at line 1 
    
    select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -10, 10 
    
    [TEP STOP]
    Plz help me out how to fix it.

    Thanks.

  2. #2
    Member
    Join Date
    Dec 2004
    Posts
    75
    Rep Power
    8


    Default Re: Need Some help.

    Quote Originally Posted by abhibh
    Hello,

    I have installed AABox.com osCMax V1.5.5. Everything is working fine but i get the following error when ever i try to access Specials under Catalog in Admin section.

    Code:
    Specials  
      
    Products Products Price Status Action  
    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 '-10, 10' at line 1 
    
    select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -10, 10 
    
    [TEP STOP]
    Plz help me out how to fix it.

    Thanks.
    Check your code in catalog/admin/specials.php that looks like this:

    Code:
        $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";
        $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);
        $specials_query = tep_db_query($specials_query_raw);
        while ($specials = tep_db_fetch_array($specials_query)) {
          if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
            $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");
            $products = tep_db_fetch_array($products_query);
            $sInfo_array = array_merge($specials, $products);
            $sInfo = new objectInfo($sInfo_array);
          }
    It looks like the -10, 10 is being appended to the query for specials_query_raw and this should not be...
    Brian Neuman
    Webmaster
    www.honeybeadjewelry.com

  3. #3
    Member
    Join Date
    Jan 2004
    Location
    Netherlands
    Posts
    71
    Rep Power
    0


    Default RE: Re: Need Some help.

    It looks like the includes/classes/split_page_results.php bug (old osC bug, but it only shows combined with newer MySQL versions)

    try:

    change:
    Code:
          $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));
          $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;
    to
    Code:
          $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));
          if($offset <0 ) $offset = 0;
          $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

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
  •