Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL Problem in Newsletter


johnkiax

Recommended Posts

Posted

Hello.

 

I have a problem when i go to the link TOOLS > Newsletter.

 

Give me the error:

 

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

 

[TEP STOP]

 

 

and i cant send the letter.

 

Thanks for all.

Posted
Hello.

 

I have a problem when i go to the link TOOLS > Newsletter.

 

Give me the error:

 

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

 

[TEP STOP]

 

 

and i cant send the letter.

 

Thanks for all.

Your version of mySQL does not support limit, -8,8 I am looking for where that is set. I have the same problem with several other modules. I did a complete search for it and it appears to be in the variable MAX_DISPLAY_SEARCH_RESULTS. I am trying to find out where that is set. IF anyone know anything, Let me know

 

John

Posted
Your version of mySQL does not support limit, -8,8 I am looking for where that is set. I have the same problem with several other modules. I did a complete search for it and it appears to be in the variable MAX_DISPLAY_SEARCH_RESULTS. I am trying to find out where that is set. IF anyone know anything, Let me know

 

John

from charles in anther list

 

to fix this

 

In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines

 

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

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

change to

 

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

if ($offset < 0)

{

$offset = 0 ;

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

MySQL 4.1.xx handles negatives correctly (by forcing an error) in the code above unlike earlier versions of MySQL.

Posted
from charles in anther list

 

to fix this

 

In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines

 

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

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

change to

 

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

if ($offset < 0)

{

$offset = 0 ;

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

MySQL 4.1.xx handles negatives correctly (by forcing an error) in the code above unlike earlier versions of MySQL.

 

 

THANKS!!! now works fine! =)

Archived

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

×
×
  • Create New...