jQuery easyui datagrid dynamic query data example explanation_jquery
WBOY
Release: 2016-05-16 17:41:25
Original
1226 people have browsed it
The plug-in group is small and easy to use. The following is an example of submitting query conditions from the front desk and returning json data from MSSQL HTML front-end code
include_once("auth.php"); include_once("inc/ms_conn.php"); include_once("inc/comm_function.php") ; $PersonCode=$_POST["PersonCode"]; //Parameters passed from the front end $KQYM=$_POST["KQYM"]; $sqlstr="Exec dbo.HR_Prg_GetPersonYMKQ2 '$KQYM ','$PersonCode'"; $rs =mssqlquery($sqlstr); //Customized mssql method, similar to mssql_query method $row = mssql_num_rows($rs); //Get the total number of rows $result["total"] = $row; $items =array(); while ($row = mssql_fetch_array($rs)){ foreach($row as $key= >$value){ //This is very important. PHP’s json_encode only supports utf-8, otherwise the field value containing Chinese characters will be set to null $row[$key]=iconv('gb2312', 'UTF-8',$row[$key]); } array_push($items, $row); } $result["rows"] =$items; echo json_encode($result ); ?>
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn