PHP jqGrid不返回数据

PHP jqGrid不返回数据,php,jqgrid,jqgrid-php,Php,Jqgrid,Jqgrid Php,我在Mac开发环境中设置了一个非常基本的jqGrid。一切正常。网格渲染和数据加载没有问题 当我将整个站点移动到我的Windows机器上时,除了jqGrid之外,该站点运行良好。由于某种原因,网格无法访问数据。我使用一个PDO对象来连接和查询数据库。当我从Mac切换到Windows box时,数据库凭据没有更改。我可以将PDO对象与网格分开使用,但当我将对象传递到网格时,它似乎不起作用: <?php require_once '../Grid/jq-config.php'; // inc

我在Mac开发环境中设置了一个非常基本的jqGrid。一切正常。网格渲染和数据加载没有问题

当我将整个站点移动到我的Windows机器上时,除了jqGrid之外,该站点运行良好。由于某种原因,网格无法访问数据。我使用一个PDO对象来连接和查询数据库。当我从Mac切换到Windows box时,数据库凭据没有更改。我可以将PDO对象与网格分开使用,但当我将对象传递到网格时,它似乎不起作用:

<?php

require_once '../Grid/jq-config.php';
// include the jqGrid Class
require_once "../Grid/php/jqGrid.php";
// include the PDO driver class
require_once "../Grid/php/jqGridPdo.php";
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
//$conn->query("SET NAMES utf8");

$selectCommand = "SELECT VolunteerID, FirstName, LastName, PhoneNumber, Email FROM Volunteers";

// Definition of the labels
$vLabels = array("VolunteerID"=>"Id",
    "FirstName" => "First Name",
    "LastName" => "Last Name",
    "PhoneNumber" => "Phone Number",
    "Email" => "Email");

// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = $selectCommand;
// set the ouput format to json
$grid->dataType = "json";
// Let the grid create the model
//$grid->setColModel(null, null, $vLabels);
$grid->setColModel();



// Set the url from where we obtain the data
$grid->setUrl('VolunteerListGrid.php');
// Set grid caption using the option caption

$grid->setGridOptions(array(
    "caption"=>"Volunteers",
    "rowNum"=>10,
    "sortname"=>"VolunteerID",
    "hoverrows"=>true,
    "rowList"=>array(10,20,50)
    ));

// Enjoy
$grid->renderGrid('#grid','#pager',true, null, null, true, true);

//$test = $conn->query($selectCommand);
//$data = $test->fetchAll(PDO::FETCH_ASSOC);
//
//echo json_encode($data);


$conn = null;

?>

我不知道是什么变化导致了这个问题

谢谢,
JA

我想你需要机会
$grid->setColModel()
$grid->setColModel($vLabels)

您是否在日志中看到任何错误消息?