I think the problem is with TBL_MEMBERS. I assume this is a view (subtitle). So, if you have a product table and you want to follow these instructions:
select sql_calc_found_rows * from select id, code, name, slug, info from products order by code
You will get the following error:
SQL Error (1064): You have an error in the SQL syntax; check the manual that matches your MySQL server version for the correct syntax to use next to "select id, code, name, slug, info from products order by code" on line 1
But if you change the request to:
select sql_calc_found_rows * from (select id, code, name, slug, info from products) v order by code
it will work.
To summarize, TBL_MEMBERS is a representation that should be placed in brackets and given an alias (i my example alias is 'v')
gandra404
source share