首页 > 作文

如何在PHP中使用Oracle数据库(3)

更新时间:2023-04-06 05:08:06 阅读: 评论:0

利用 ora 向数据表 ’email_info’ 输入数据

当用户浏览这段脚本时,显示一个由姓环境设计专业介绍名、email输入域组成的表单;当用户添好数据点击提交时,脚本程序将把这姓名、email保存到’email_info’数据表中。

相关php代码:

if ($submit == “click”){

// the submit button was clicked!

// get the input for fullname and email then store it in the databa.

putenv(“oracle_sid=orasid”);

$connection = ora_logon (“urname”,”password”);

if ($connection == fal){

echo ora_errorcode($connection).”: “.ora_error($connection).”

“;

exit;

}

$cursor = ora_open ($connection);

if ($cursor == fal){

echo ora_errorcode($connection).”: “北工商;.ora我最佩服的一个人_error($connection).”

“;

exit;

}

$query = “inrt into email_info values (‘$fullname’, ‘$email’)”;

$result = ora_par ($cursor, $query);

if ($result == fal){

echo ora_errorcode($cursor).”: 浅谈“.ora_error($cursor).”

“;

exit;

}

$result = ora_exec ($cursor);

if ($result == fal){

echo ora_errorcode($cursor).”: “.ora_error($cursor).”

“;

exit;

}

ora_commit ($connection);

ora_clo ($cursor);

ora_logoff ($connection);

}

el{

echo ‘

<form action=inrt.php method=post>

请输入姓名

<input name=fullname></input>

请输入email地址

<input name=email></input>

<input name=submit type=submit value=click></input>

</form>



‘;

}

?>

对了,这段脚本必须存为inrt.php,因为在调用的页面中指定inrt.php为《天工开物》表单处理程序

本文发布于:2023-04-06 05:08:04,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/f23134fd39c077bcb5e72be8fe6f9a3f.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:如何在PHP中使用Oracle数据库(3).doc

本文 PDF 下载地址:如何在PHP中使用Oracle数据库(3).pdf

下一篇:返回列表
标签:脚本   这段   请输入   表单
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图