A suggestion to improve flexibility of db-queries:
Please add a variable "filter" to p and send it to the remote data script (like sortname or query). In the remote script you can use this filter as a "half static" WHERE-condition in the db-query. This could by useful if you work with more complex tables and dynamic php-pages to show parts of these tables (= define query-filter in php-script containing the flexigrid-table).
Example:
Front-PHP
Code:
$("#flex1").flexigrid({
url: 'get_data_from_db.php',
sortname: "name",
sortorder: "asc",
filter: "numcode > 100" // more interesting when populated by php