Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-09 07:11:28

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

txp:link_to_next "an error in your SQL syntax"

The photo gallery for my first client site is working fine except for one small problem. The “Next Photo” link on the section’s front page takes visitors to the individual article page for the same photo that’s on the section’s front page. Instead, it should take them to the next photo in the series. The troublesome link is generated by the <txp:link_to_next> tag, and works just fine on all the other pages in the photo gallery.

Turning on debugging mode rewarded me with the following message at the top of the page:

tag_error <txp:link_to_next> -> Textpattern 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 'Section = 'photos'and Status=4 and Posted < now() order by Posted desc limit 1' at line 1

select ID, Posted from 'textpattern' where 1=1 Section = 'photos'and Status=4 and Posted < now() order by Posted desc limit 1 on line 61

Note: In the second part of the error message — where it says select ID, Posted from 'textpattern' — the word “textpattern” is supposed to be surrounded by back-ticks. I changed it to single quotes because PunBB was turning the back-ticks into code tags.

Can anyone tell me what this error message means and how to fix the problem? A tag trace for the page in question can be found here. If a copy of my template code would be helpful, just let me know.

Thanks in advance! :-)

Offline

#2 2006-03-11 22:33:45

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: txp:link_to_next "an error in your SQL syntax"

Update: Problem resolved by Sencer in this TextDrive forum thread.

Offline

Board footer

Powered by FluxBB