Solved 500 Fabrik has generated an incorrect query for the list *******: <br />

alexarroyo

New Member
Hello, I have a problem and I don't know how to solve it, when I define a datajoin in a field, and search in the table of the same database, when I see the list I get the error: 500 Fabrik has generated an incorrect query for the list Actividades: <br />
 
Make sure you have enabled fabrikdebug and get more details with applying &fabrikdebug=1 in the url
1738629860525.png

Based on the error message you will be able to identify the issue.
 
Hello, after several tests the problem is when I write in "Concat label" so that in the dropdown I can see more than one field, if I remove everything it works correctly.
Captura de pantalla 2025-02-04 213007.png
 
In your concat, you're using 'id' which is very common in SQL.

So it's better to use {thistable} something like:

Code:
{thistable}.id,' - ',nombre
But I recommend being more specific:

Code:
{thistable}.id,' - ',{thistable}.nombre
 
I tried with other fields that were not called id, and the same error, now when I put {thistable}, everything works correctly. Thank you so much
 

Or Concat label examples​

Using {thistable} : {thistable} (litterally, don't replace with table name) is a placeholder which Fabrik will replace with a table alias. Necessary if you have multiple dbjoins to the same table etc. (otherwise you'll get aMySQL error like "not unique column"), it doesn't hurt to use it always.
Yes as also described in the wiki, it is always preferable to always use it
 
Back
Top