jqgrid显示不了数据解决方案
程序员文章站
2022-04-26 09:01:20
...
jqgrid显示不了数据
jqgrid显示不数据,请各位大大帮忙看看
jqgrid显示不数据,请各位大大帮忙看看
无标题文档
include_once ("connect.php");
$page = $_GET['page'];
$limit = $_GET['rows'];
$sidx = $_GET['sidx'];
$sord = $_GET['sord'];
if (!$sidx)
$sidx = 1;
$where = '';
$title = uniDecode($_GET['title'],'utf-8');
if(!empty($title))
$where .= " and title like '%".$title."%'";
$sn = uniDecode($_GET['sn'],'utf-8');
if(!empty($sn))
$where .= " and sn='$sn'";
$result = mysql_query("SELECT COUNT(*) AS count FROM products where deleted=0".$where);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$count = $row['count'];
//echo $count;
if ($count > 0) {
$total_pages = ceil($count / $limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages)
$page = $total_pages;
$start = $limit * $page - $limit;
if ($start $SQL = "SELECT * FROM products WHERE deleted=0".$where." ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query($SQL) or die("Couldn t execute query." . mysql_error());
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i = 0;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$responce->rows[$i]['id'] = $row[id];
$opt = "修改";
$responce->rows[$i]['cell'] = array (
$row['sn'],
$row['title'],
$row['size'],
$row['os'],
$row['charge'],
$row['price'],
$opt
);
$i++;
}
//print_r($responce);
echo json_encode($responce);
function uniDecode($str, $charcode) {
$text = preg_replace_callback("/%u[0-9A-Za-z]{4}/", toUtf8, $str);相关文章
相关视频
推荐阅读
-
Windows 64位下装安装Oracle 11g,PLSQL Developer的配置问题,数据库显示空白的完美解决方案(图文教程)
-
后端返回数据中的换行符,在标签中不显示换行的解决方案
-
数据库日期时间显示在页面上格式错误的解决方案
-
电脑启动时显示Ntoskrnl.exe丢失 进不了系统的解决方案
-
关于VS2017,VS2015 中利用 EF使用Mysql 不显示数据源问题解决方案
-
flex实现DataGrid高亮显示数据功能的解决方案
-
Android ConstraintLayout 下 RecyclerView 的底部数据显示不全解决方案
-
PHP查询mysql,中文数据,通过不同方式添加的相同数据竟然显示不同解决方案
-
jqgrid表格无数据时显示提示
-
jqgrid显示不了数据