Any ideas, please
Sometimes AppGini has to append numbers to table-aliases to avoid duplicates in SQL commands, especially when joining tables, especially when joining the same table multiple times. It could be that, for example, AppGini does not address
`TABLENAME`
but
`TABLENAME1`
instead.
If, for example, AppGini has already joined
membership_userrecords
,
membership_users
,
membership_groups
and/or
*_permissions
for applying group- and user-specific constraints, there could be a name- and/or alias-collision with your specific, custom join.
So, for me it is always helpful for debugging to see the actual
final SQL statement.
As we have seen, MySQL only names a part of the SQL command on errors ("... NEAR ...") which sometimes helps, sometimes not at all.
When you have found the place where AppGini executes the final SQL statement, it could help to
var_dump(...); exit();
and check the complete
final SQL which raises the error.
Tip
In latest version we also have the Query Log feature in Admin Area. The invalid SQL statement should be listed there completely (not partly) which could help finding naming collisions
This is just an idea.