How do I use the single search feature of jqGrid?
Im following the example “Single Search” under “New in version 3.7”. jqGrid Demo Page
My script is almost exact save the queries used to retrieve data from the database but my script doesn’t do the filtering.
Can anyone point me to a complete example of the single search feature using PHP?
I also have a question regarding the script in the demo page.
- How does jQuery pass the conditions to PHP to filter the results? I’ve notice in the query it had a variable
$wherebut the variable wasn’t declared in the PHP script.
I’ve made up an example using the MySQL database.
First of all create a “test” database, an “items” table, and insert some records:
Next, create the html page “singlesearch.html”:
Then create a PHP page “localset.php”:
Enable the PHP mysqli extension in your PHP.INI file, adjust the connection parameters in the “localset.php” script (at line 15), and finally open the “singlesearch.html” page in your browser.