To make your PHP support Oracle, follow these steps:
1. To install the php environment, look for appserv or xampp and install it with one click, very convenient
2. Copy php_oci8.dll in the ext directory of php to the system32 directory
3. Modify the configuration in the php.ini file, remove ;extention = php_oci8.dll, and remove the preceding semicolon
4. Restart apache
Two ways to establish a link with oracle database
1.$conn = oci_connect('username','password',"(DEscriptION=(ADDRESS=(PROTOCOL =TCP)(HOST=192.168.1.100)(PORT = 1521))(CONNECT_DATA =(SID=test )))");
2.$conn = oci_connect('username','password','192.168.1.100/test');
Sometimes the first method does not work, use the second method. The parameters are user name, password, oracle service address, where test is the service name.
$sql = "select * from table_exmaple"
$ora_test = oci_parse($conn,$sql); //Compile sql statement
oci_execute($ora_test,OCI_DEFAULT); //Execute
while($r=oci_fetch_row($ora_test)) //Retrieve the result
{
echo $ora_test[0];
echo "
";
}
http://www.bkjia.com/PHPjc/532692.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532692.htmlTechArticleTo make your php support oracle, follow the following steps: 1. Install the php environment and look for appserv or xampp , one-click installation, very convenient 2. Copy php_oci8.dll in the ext directory of php to system3...