用php连接oracle首先要在php.ini中把 extension=php_oci8.dll extension=php_oracle.dll 前的分号“;”去掉,然后重启apache就行了,这样php就支持oracle了.以下是程序代码:
$connection=Ora_Logon("123");
if($connection==false){
echoOra_ErrorCode($connection).":".Ora_Error($connection)."";
exit;
}
$cursor=Ora_Open($connection);
if($cursor==false){
echoOra_ErrorCode($www.ewinvip.com).":".Ora_Error($connection)."";
exit;
}
$query="createtableemail_info"."(fullnamevarchar(255),email_addressvarchar(255))";
$result=Ora_Parse($cursor,$www.jnha.info);
if($result==false){
echoOra_ErrorCode($cursor).":".Ora_Error($cursor)."";
exit;
}
$result=Ora_Exec($cursor);
if($result==false){
echoOra_ErrorCode($cursor).":".Ora_Error($cursor)."";
exit;
}
Ora_Commit($connection);
Ora_Close($cursor);