osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 04-12-2005, 02:08 AM
Lurker
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
abhibh
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 04-12-2005, 02:17 PM
Member
 
Join Date: Dec 2004
Posts: 75
Thanks: 0
Thanked 3 Times in 2 Posts
Rep Power: 4
bdneuman is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 04-12-2005, 02:42 PM
Member
 
Join Date: Jan 2004
Location: Netherlands
Posts: 71
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
paulM
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;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
The Following User Says Thank You to paulM For This Useful Post:
daffodil (05-20-2007)
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -8. The time now is 11:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax