ÎÒÒÔÇ°ÓÃphpÁ¬½ÓÔ¶³Ìoracle8.0.5 for NT ÆoÒµ°ae,ÓÃODBC,oracle½Ó¿Ú¾u²»ÐС£¼±É*ÎÒÒ²£¡Ñ°Ñ°ÃÙÃÙ£¬ÖÕÓÚÕÒµ½ÁËÁ¬½ÓµÄÕýÈ*½¨£¬ÎÒÕaÀiÓÃOCI½Ó¿Ú£¬ODBCÓeoracle»¹ÊÇûÓÐÕÒ%m÷¿?ŽB5½½a¾o°i¨¡£ÓÐÒ»¸?OCI×aÒÑ¡¢×aÒÑ£¡
Ô´ÂeÈçÏ£º
<?php
$dbconn=OCILogon("zypdp","zypdp","(DESCRIPTION=(ADDRESS=(PROTOCOL =TCP)(HOST=10.65.73.3)(PORT = 1521))(CONNECT_DATA =(SID=ORCL)))");
if($dbconn!=false)
{
echo "Á¬½Ó³É¹¦";
if(OCILogOff($dbconn)==true)
{
echo "¹Ø±ÕÁ¬½Ó³É¹¦!";//=ÕaÀiÓÐÎÊÌa
}
}
else
{
echo "Á¬½Óʧ°Ü";
}
?>
-----------------½aÊÍ------------------------------
-----1¡£-PHP4²Î¿¼ÊÖ²a£º£¨Àö«Î÷£(C)
OCILogon
´o¿ªÓe Oracle µÄÁ¬½a¡£
Ói¨: int OCILogon(string username, string password, string [OCACLE_SID]);
µ»ØÖµ: ÕuÊý
º¯ÊýÀaÐÍ: Êý¾Ý¿a¹¦ÄÜ
ÄÚÈÝ˵Ã÷
±¾º¯Êýʹ PHP Óe Oracle ½¨Á¢Á¬½a¡£²ÎÊý username Óe password Ö±ðΪÁ¬½ÓµÄÕʺż°ÃÜÂe¡£²ÎÊý OCACLE_SID ΪÊý¾Ý¿aÃu³Æ£¬¿ÉÊ¡ÂÔ¡£µ»ØֵΪÁ¬½ÓµÄ´uÂe¡£
---2¡£ÎҵĽaÊÍ£º
Óû§Ãu£¬ÃÜÂe²»±ØÎÒ˵£¬ÎÒҪ˵OCACLE_SIDÓ¦¸Ã½ÐÁ¬½Ó±eʶ´®£¬"(DESCRIPTION=(ADDRESS=(PROTOCOL =TCP)(HOST=10.65.73.3)(PORT = 1521))(CONNECT_DATA =(SID=ORCL)) "
ADDRESS:oracleþÎñÆ÷µØÖPROTOCOLΪ´«ÊaÐÒe,Ò»°aÓÃTCP;HOST:þÎñÆ÷IPµØÖ£»PORT:¶Ë¿ÚºÅ£¬È±Ê¡¾ÍÊÇËu¡£
CONNECT_DATA :ÕaÀiÊÇÊý¾Ý¿aÃu£¬»oÕß˵ÊÇOracleÊý¾Ý¿aÆo¶¯þÎñÃu£¬ÔÚ¡°þÎñ¡±¿ÉÒÔÕÒµ½¾ßÌaµÄÃu×Ö£¬Ö»ÒªÄaµÄOracleÊÇÈ´Ê¡°²×°£¬ÄǾÍÊÇOCRL.
---3.ÄaÒª×oʲô£¡
£¨1£(C)ÈÈÏÄaµÄphpÅaÖÃÁËŶphp_oci8.dll¶¯Ì¬¿a¡£
£¨2£(C)ÈÈÏ°²×°ÁËOracle8i¿Í»§¶Ë£¬»oþÎñÆ÷¡£
£¨3£(C)ÕÒµ½ÄaµÄOracleþÎñÆ÷µÄip,²¢¸u¸ÄΪÄaµÄIP,ÓeÊý¾Ý¿aÃu
£¨4£(C)±ðÍuÁË£¬ÄaÒªÓÐÃÎÊÔ¶³ÌÊý¾Ý¿aµÄÓû§ÃuÓeÃÜÂe
Íoʾa±¸£¡È¥×o°É£¡£¡£¡