How do I see the SQL SELECT query sent by PHPCG to build my READ list?

The READ List SELECT query is sent by your table main class, in admin/class/crud/YourTable.php.


Revealing the SELECT query

The SQL query sent to your server to get the matching records depends on several parameters:

  • User's rights on the active table
  • Active filters
  • Relations (including user's rights on the related table(s)
  • Sorting
  • Pagination

PHPCG analyses these parameters and builds the query for you.


To display the SQL query on your page (for debugging purpose):

  1. Open your table main class (admin/class/crud/YourTable.php)
  2. Uncomment the following line:
    // echo $qry_start . $qry_restriction . $active_filters_join_queries . $filters_where_qry . $qry_sorting;

PHP CRUD tutorial main page