Bug #10650 Bug Fixed

SQL 1064 Error on Search Results Pagination

Version: EE 2.0.0PB 20091211 Reporter: A-P

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

exp:search:simple_form returns results {exp:search:search_results} as expected, but when a pagination link is clicked, the following error occurs:

Error

Error Number: 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 ‘/10, 10’ at line 11

SELECT DISTINCT(t.entry_id), t.entry_id, t.channel_id, t.forum_topic_id, t.author_id, t.ip_address, t.title, t.url_title, t.status, t.dst_enabled, t.view_count_one, t.view_count_two, t.view_count_three, t.view_count_four, t.allow_comments, t.comment_expiration_date, t.sticky, t.entry_date, t.year, t.month, t.day, t.entry_date, t.edit_date, t.expiration_date, t.recent_comment_date, t.comment_total, t.site_id as entry_site_id,
    w.channel_title, w.channel_name, w.search_results_url, w.search_excerpt, w.channel_url, w.comment_url, w.comment_moderate, w.channel_html_formatting, w.channel_allow_img_urls, w.channel_auto_link_urls,
    m.username, m.email, m.url, m.screen_name, m.location, m.occupation, m.interests, m.aol_im, m.yahoo_im, m.msn_im, m.icq, m.signature, m.sig_img_filename, m.sig_img_width, m.sig_img_height, m.avatar_filename, m.avatar_width, m.avatar_height, m.photo_filename, m.photo_width, m.photo_height, m.group_id, m.member_id, m.bday_d, m.bday_m, m.bday_y, m.bio,
    md.*,
    wd.*
  FROM exp_channel_titles AS t
  LEFT JOIN exp_channels   AS w ON t.channel_id = w.channel_id
  LEFT JOIN exp_channel_data AS wd ON t.entry_id = wd.entry_id
  LEFT JOIN exp_members AS m ON m.member_id = t.author_id
  LEFT JOIN exp_member_data AS md ON md.member_id = m.member_id
  WHERE t.entry_id IN (23653,25498,25499,31037,34269,36939,39123,40620,40621,40622,40623,40624,40626,40646,42236,43144,43145,46949,48080,48368)  ORDER BY entry_date desc LIMIT /10, 10

Seems to be an error in the SQL syntax in the order by clause - forward slash before the results variable (in this case 10).

Related thread:
http://ellislab.com/forums/viewthread/138167

mod edit:  added code tags

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases