The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Search SQL Error - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Search SQL Error (/showthread.php?tid=397)



Search SQL Error - axel - Dec 12th, 2009

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.
Code:
Error:
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
Debug:

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.


RE: Search SQL Error - axel - Dec 13th, 2009

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! =]


RE: Search SQL Error - Ben - Dec 13th, 2009

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


RE: Search SQL Error - Ben - Dec 13th, 2009

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


RE: Search SQL Error - alton - Dec 29th, 2009

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!