脚本宝典收集整理的这篇文章主要介绍了如何在PHP中使用Oracle数据库(4),脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
利用OCI向数据表 'em
ail_info'
输入数据 同上,只
不过用OCI来写&nbs
p; 相关
PHP代码:
if ($s
ubm
IT == "click"){
// The submit button was clicked!
// Get the input for fulln
ame and email then
Store it in the database.
Put
env("
oracle_SID=ORASID");
$connection = OCI
logon ("username","password");
if ($connection == false){
echo OCIError($connection)."
";
exit;
}
$query = "insert into email_info values ('$fullname','$email')";
$cursor = OCIParse ($connection,$query);
if ($cursor == false){
echo OCIError($cursor)."
";
exit;
}
$result = OCIExecute ($cursor);
if ($result == false){
echo OCIError($cursor)."
";
exit;
}
OCICommit ($connection);
OCI
logoff ($connection);
}
else{
echo '
<FORM action=insert.
PHP method=post>
请输入姓名
<INPUT name=fullname></INPUT>
请输入 Email 地址
<INPUT name=email></INPUT>
<INPUT name=submit ty
PE=submit value=click></INPUT>
</FORM>
';
}
?>
对了,这段脚本必须存为insert.
PHP,因为在
调用的
页面中指定insert.
PHP为表单处理程序
脚本宝典总结
以上是脚本宝典为你收集整理的如何在PHP中使用Oracle数据库(4)全部内容,希望文章能够帮你解决如何在PHP中使用Oracle数据库(4)所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。