The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search SQL Error
After I've searched for a submission inside of a Form, and the list of the results appear, now I get a SQL error.

I only get the error when I do a search and then click to edit the submission.
Failed query in ft_get_search_submission_ids:
SELECT submission_id
FROM flammable_form_15
WHERE is_finalized = 'yes'
AND ()

ORDER BY submission_date asc, submission_id

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 ') ORDER BY submission_date asc, submission_id' at line 4

I checked, it's happening across Form Tools.
Interestingly enough, I found out that you may have modified something when you updated the Search Columns in the latest fix.

On the ../global/code/submissions.php page, on line 594-595, there is a line with the variable $search_where_clause and when you remove it, My error goes away.

I have no idea why this is happening. The $search_where_clause is built using the $form_id, $search_fields, $search_columns.

Are any of those changed in this new version?

Anyways, point being, Form Tools works again.
Which makes my day! =]
Thanks for this, Axel. Smile Sorry you're having such a rough go of it lately.

A couple of other folks noticed another problem in another thread, so I'll address this and that problem in today's build.

- Ben
Hey Axel,

I did some testing and couldn't actually reproduce this one. However, the _ft_get_search_submissions_search_where_clause() function in submissions.php (which generates the AND clause for the search strings in the search function) isn't doing it's job very well. It *is* possible that it would be generating that dud SQL that you posted (I just can't figure out how to get it to do it!). So instead, I've updated the code to ensure that it only adds the AND clause if there's actually something there.

I'll include this fix in today's build.

Thanks again for the info - it was invaluable for tracking this one down.

- Ben
Hi there,

I haven't got any ideas, but I was wondering if you ever got a solution
as I would like to do the same thing. Cheers!

Forum Jump:

Users browsing this thread: 1 Guest(s)