PHPでOracle を使う、データをクエリ

<?php
$db_server = “localhost";
$db_user = “TPARK";
$db_pass = “startnew24";
$db_sid = “atyu30″;
$dbconn=oci_connect($db_user,$db_pass,"(DEscriptION=(ADDRESS=(PROTOCOL =TCP)(HOST=127.0.0.1)(PORT = 1521))(CONNECT_DATA =(SID=$db_sid)))");
?>

<?php
include_once(“config.php");
/*
if($dbconn!=false)
{
echo “接続";
echo “DBサーバ:".$db_server;
echo “ユーザ名:".$db_user;
echo “パスワード:".$db_pass;
echo “SID:".$db_sid;
echo “成功\n";

if(OCILogOff($dbconn)==true)
{
echo “接続を閉じる!";
}
}
else
{
echo “接続失敗";
}
*/

$sql = “select * from editor";
$oci_rs = oci_parse($dbconn,$sql);
oci_execute($oci_rs,OCI_DEFAULT);
while($row=oci_fetch_array($oci_rs,OCI_ASSOC)) {
print_r($row);
}
?>

Software,Source

Posted by arkgame