Support Forum

SQL Syntax Error Report

JI jim
jim
Member

Toolbox – Error Log: Error
Errors should be reported to Simple:Press support…

Here’s one for you…

9 October 2015 5:05 am | spaErrError | 1 | database


file: /home/tripawds/public_html/wp-content/plugins/simple-press/forum/content/classes/sp-search-view-class.php
line: 228
function: select
error: 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 ‘-30, 30’ at line 1

SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_1_sfposts.topic_id FROM wp_1_sfposts WHERE user_id=7341 AND post_index=1 AND wp_1_sfposts.forum_id IN (5,6,7,20,9,8,19,10,17,11,15,12,4,24,14,13,22,18,16,1,25) ORDER BY wp_1_sfposts.topic_id DESC LIMIT -30, 30

 

This has clearly been in the log a while, and I don’t think we’re experiencing any symptoms. But it’s an error, so I figured it should be reported nonetheless.

Any questions, jut let me know!

6 Answers

New Answer

MP Mr Papa
Mr Papa
Member

hmmm…  the problem there is the -30…  but not quite sure how you could have gotten that there… 

it seems to indicate you had perhaps a negative page for the search query… and to get that, I think it would have manually had to be entered…  will have to see if another way to get it, but worth noting you only see it once… but we will take a look…

JI jim
jim
Member

Mr Papa said
…you had perhaps a negative page for the search query…

Guess I’m not exactly sure what that means, but I figured it was probably a fluke.

Thanks anyway!

YS Yellow Swordfish
Yellow Swordfish
Member

Steve was proposing that someone used the ‘jump to page’ form and entered a negative number. Seems a likely scenario actually. While a nonsense thing to do we should be able to prevent that actually. I will take a look when I have some spare time…

JI jim
jim
Member

Yellow Swordfish said
Steve was proposing that someone used the ‘jump to page’ form and entered a negative number…

Makes sense, and would explain the rare occurrence.

Thanks for the clarification!

This obviously isn’t important and I’m sure you have bigger fish to fry…but for what it’s worth, I just tested your theory.

Jump to page with value of -3 in a three-page forum returned me to page 1 of the thread, with no error displayed nor generated in the log. And a jump to page 5 in the same forum took me to page 3, also with no error.

I say blame it on the gremlins.

YS Yellow Swordfish
Yellow Swordfish
Member

Yes – I tried it also after I wrote that explanation and saw it couldn’t really be the issue…
Another method would be someone putting it in the url to see what happened. That wouldn’t have the same check.

MP Mr Papa
Mr Papa
Member

changing the url is actually what I meant…  it doesnt have a guard check for page being less than 1…   we should probably add at some point – its an error condition, but would prevent us from generating mysql error…