Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

From Admin left side links I get 1064 message


ozstar

Recommended Posts

I have tried a few of the fixes after a osc forum serach,. but still can't get it.

 

I have this version..

 

In Application_top.php Line 37

 

// define the project version

define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

 

Due to my server upgrading to PHP5 and mySQL 5, I have had to make some changes due to the 1054 error. All seems fime now except I get these in the Admin area left side links.

 

------------------------------------------------------------------------

Best Products Purchased

 

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, p.products_ordered, pd.products_name from products p, products_description pd where pd.products_id = p.products_id and pd.language_id = '1' and p.products_ordered > 0 group by pd.products_id order by p.products_ordered DESC, pd.products_name limit -20, 20

 

 

-------------------------------------------------------

 

Newsletter Manager

 

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 newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from newsletters order by date_added desc limit -20, 20

 

Thanks

 

 

Oz :-)

Link to comment
Share on other sites

Got it!!..

 

In Admin/classes/split_page_results.php

 

Find this..

 

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

 

insert this..

 

if ($offset<0) $offset=0;

 

Before this..

 

$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;

 

 

Good Luck!

 

Oz :-)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...