I’m working on a website containing a jqGrid.
Im selecting the values from database with an sql statement like this :
$grid->SelectCommand = 'Select id,name from users';,
I tried to change the statement to stored procedure like this :
$grid->SelectCommand = 'CALL getUsers()';
but i discovered that this is impossible, however i googled alot, and couldnt find any example related with jqGrid with stored procedure. I was just wondering if that was possible ?Thanks for your help
To get SQL rows from a stored procedure and load the data into the jqGrid, you need to configure your jqGrid JavaScript control by pointing its
urlproperty to the PHP file action, which will provide the JSON data.In the PHP file, you call the stored procedure
$result = mysql_query("select getUsers()");. And then you convert your SQL data to JSON object with the PHP functionjson_encodeCheck the below example link for that:
And, jqGrid – The HTML:
, for more information.