使用PHP Web服务从Oracle数据库表中检索数据时出现此错误: 它显示警告 - 不支持的json
Warning: [json] (json_encode_r) type is unsupported, encoded as null.
这是我的代码:
<?php
require_once("Classes/abc.php");
$h=new NetworkLevel();
$rs=$h->GetWEBSERVICE_STATS();
//$h->Display($rs); -- commented
echo json_encode($rs);
?>
这是我的NetworkLevel类代码:
<?php
require_once('connect.php');
class NetworkLevel
{
public $fdate;
public $tdate;
public function Display($recordset)
{
rs2html($recordset);
}
function GetWEBSERVICE_STATS()
{
$xCon=Connect();
$xCon->SetFetchMode(ADODB_FETCH_ASSOC);
$str="Select * from DEPT";
$recordset= $xCon->Execute($str);
return $recordset;
}
catch (exception $e)
{
var_dump($e);
}
return $recordset;
}
}
?>