ORA-12504 warning in PHP

<?php
$conn = oci_connect('proekt', 'proekt1', 'localhost:1521');

$stid = oci_parse($conn, "select 1+2 as sum from dual");
oci_execute($stid);
$row = oci_fetch_array($stid, OCI_BOTH);
echo $row[SUM];
?>

Warning: oci_connect(): ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA in /var/www/test.php on line 2


$conn = oci_connect('proekt', 'proekt1', ' (DESCRIPTION =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  )
  (CONNECT_DATA =
    (SERVICE_NAME = proekt)
  )
)');

posted @ 2018-01-16 10:58  追忆丶年华  阅读(252)  评论(0编辑  收藏  举报