Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

'Specials' Options Error


innovationsuk

Recommended Posts

In admin, when i click the specials option, i get the following message.

 

 

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 '-20, 20' 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 -20, 20

 

[TEP STOP]

 

 

 

CAN ANYONE HELP PLEASE? :(

Link to comment
Share on other sites

it's a famous error with particular mysql version.

 

solution

 

In admin/includes/classes/split_page_results.php, change below:

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

//BoF patch
if ($offset < 0) { $offset = 0; }
//EoF patch
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
}

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

  • 2 weeks later...
thanks i changed that but now i get lots of errors - for instance

 

Fatal error: Call to undefined function: display_count() in /usr/local/psa/home/vhosts/innovationsuk.org/httpdocs/catalog/admin/specials.php on line 220

 

 

i get the same error.. when i use the option specials in admin area

 

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 '-20, 20' 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 = '4' and p.products_id = s.products_id order by pd.products_name limit -20, 20

 

 

what shall i do?

 

everything else works fine

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...