how can i see entire query ? August 19, 2019, 03:30:24 AM Im getting this SQl error on a page i didnt change at all and im at a lost whats causing it. I need to see the entire query, this is not telling me the problem. I dont know what Index= Null means, i have no such field. Is there a way to see it as its passed to mysql ?"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Index = NULL ORDER BY g DESC, h DESC LIMIT 1000 OFFSET 0' at line 1"Thanks for any help. Quote Selected
Re: how can i see entire query ? Reply #1 – August 19, 2019, 08:36:56 AM @nepo77 what page do you see this error? Quote Selected 1 Likes
Re: how can i see entire query ? Reply #2 – August 19, 2019, 02:10:49 PM It is the List Page of a table in classic 2.59 . It was originally created with 2.5.1.I used the duplicate page feature to make another one based on this one which was working and then after publish it no longer worked. Quote Selected
Re: how can i see entire query ? Reply #3 – August 20, 2019, 08:58:55 AM Inside the ListPageController you can call Code: [Select]echo $db->getLastQuery(); After the Code: [Select]$db->get() command. Quote Selected
Re: how can i see entire query ? Reply #4 – August 20, 2019, 02:33:07 PM I did this$records = $db->get($tablename, $limit, $fields); echo $db->getLastQuery();But doesnt show anything for me besides the standard error. Quote Selected
Re: how can i see entire query ? Reply #5 – August 20, 2019, 03:56:49 PM Quote from: nepo77 – August 20, 2019, 02:33:07 PMI did this$records = $db->get($tablename, $limit, $fields); echo $db->getLastQuery();But doesnt show anything for me besides the standard error. try to add Try Catch and add echo $db->getLastQuery in Catch. The error in $records line is not allowing the code to move on to the next line. try {$records = $db->get($tablename, $limit, $fields);}catch(\Exception $e) {echo $db->getLastQuery();} Quote Selected
Re: how can i see entire query ? Reply #6 – August 20, 2019, 09:01:03 PM Thanks that worked!Now the query displayed isSELECT SQL_CALC_FOUND_ROWS id, b, pseudo, f, g, h, altersklassen.id AS altersklassen_id, altersklassen.Klasse, kategorien.id AS kategorien_id, kategorien.kategorie FROM meisterschaft WHERE e REGEXP '[a-zA-Z]' AND Index = NULL ORDER BY g DESC, h DESC LIMIT 10 OFFSET 0 and mysql sais syntax error near Index=NullWhich i dont understand cause i never had a field named Index in there... Quote Selected
Re: how can i see entire query ? Reply #7 – August 21, 2019, 08:48:37 AM @nepo77 try locating the file this Index = NULL is being added. Quote Selected