<?php
error_reporting(0);
header("constent-type:text/html;charset=ZHS16GBK");
$conn = oci_connect('mxx','xxx','xxx:1529/xxx','ZHS16GBK');
if($conn!=false)
{
echo "连接成功".'<br/>';
$sql = " SELECT t.user_name,".
" t.display_name,".
" t2.role_name,".
" t.account_type,".
" t.state,t.*,t1.*".
" FROM mespro.SYS_USER_PROFILE t".
" left join mespro.SYS_USER_IN_ROLE t1".
" on t1.user_id = t.id".
" left join mespro.SYS_ROLE t2".
" on t2.id = t1.role_id".
" where t.user_name in('wangjue3')";
echo $sql;
$ps = oci_parse($conn,$sql); //编译sql语句
oci_execute($ps);//执行
while($row=oci_fetch_assoc($ps)){
echo "xx";
echo $row["ROLE_NAME"];
echo "<br>";
}
if(OCILogOff($conn)==true)
{
echo "关闭连接成功!".'<br/>';//
}
}
else
{
echo "连接失败".'<br/>';
}
?>
|