PHP   发布时间:2022-04-09  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何在PHP中使用Oracle数据库(5)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
利用ORA列出全部数据表'email_info'中的数据


下面,我们将逐条读出数据库内容,并以html表格形式显示'email_info'数据表中的数据  

相关PHP代码:


PutEnv("oracle_sid=ORASID");

$connection = Ora_logon ("username","password");
if ($connection == falsE){
  echo Ora_ErrorCode($connection).": ".ora_Error($connection)."
";
  exit;
}

$cursor = Ora_Open ($connection);
if ($cursor == falsE){
  echo Ora_ErrorCode($connection).": ".ora_Error($connection)."
";
  exit;
}    

$query = "SELEct * from email_info";
$result = Ora_Parse ($cursor,$query);
if ($result == falsE){
  echo Ora_ErrorCode($cursor).": ".ora_Error($cursor)."
";
  exit;  
}

$result = Ora_Exec ($cursor);
if ($result == falsE){
  echo Ora_ErrorCode($cursor).": ".ora_Error($cursor)."
";
  exit;
}

echo " ";
echo "  Full Name Email Address  
";

while (Ora_Fetch_Into ($cursor,&$values)){
  $name = $values[0];
  $email = $values[1];

  echo "  $name $email  
";
}

echo " ";

Ora_Close ($cursor);
Ora_logoff ($connection);

?>  


程序运行的浏览效果如下所示:

    
姓名 Email 地址  
春花 springflower@163.com  
秋月 autumnmoon@163.com  
... ...  

大佬总结

以上是大佬教程为你收集整理的如何在PHP中使用Oracle数据库(5)全部内容,希望文章能够帮你解决如何在PHP中使用Oracle数据库(5)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。