연결하려는 Oracle 데이터베이스가 있습니다. 나는 다음과 같은 코드를하려고 몇 가지 이유를 들어 PHP에서 Oracle 데이터베이스에 연결
: 나는 위의 코드를하려고하면<?php
include "header.php";
// simply attempt to connect to the database
/* If you are connecting to the Oracle database, the credentials are as follows:
* Username: ********
* Password: ********
* Hostname: **********
* Port: 1521
* Service name: ***********
*/
$oracleConnect = true;
if ($oracleConnect)
{
echo 'Attempting connection...<br>';
$connection = null;
try
{
$connection = oci_connect('user',
'pass',
'[email protected]//hostname:1521/dbname');
}
catch (Exception $e)
{
echo $e->getMessage();
}
if (!$connection)
{
echo '<p>Something is wrong.</p>';
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
// if the connection has been established
else
{
// tell the user and close it (this is a test)
echo 'Connection established!!';
oci_close($connection);
}
}
else
{
$connection = new mysqli('host', 'user', 'password', 'database');
echo ($connection) ? 'Database connection successful!' : 'Could not connect.';
}
include "footer.php";
?>
, 나는 "... 시도 접속"를 얻을 인쇄 할 수 있지만, 아무것도. 그것은 관계없이 다른 것을 인쇄하기로되어 있습니다. 무엇이 잘못 될 수 있습니까?
프로세스가 입력되었는지 확인하기 위해 "try"에서 뭔가를 울립니다. ' php' 태그'error_reporting (E_ALL);의 직후에 파일의 맨 위에 오류보고를 추가하십시오; ini_set ('display_errors', 1);' –