[Linux-programlama] Re: Oracle Baðlantýsý

---------

[Linux-programlama] Re: Oracle Baðlantýsý

From: <ahmet_at_duruoz.gen.tr>
Date: Tue, 23 Oct 2007 16:49:43 +0300 (EEST)
Message-ID: <12062.212.175.131.130.1193147383.squirrel@mail.duruteknoloji.com>

Merhaba,
Aþaðýdaki link faydalý olacaktýr.

http://www.orafaq.com/faqphp.htm#CONFIG

Aþaðýdaki kodu da inceleyebilirsiniz.

<?

$ora_conn = ora_logon("user/passswd_at_TNS_NAME",
"") or die("Can't connect to db");
$query =
"select * from tablo";
// Comment the line error_reporting
if you want to
// debug your code - for example the "NO DATA
FOUND"
// when no result. Oracle returns this like an error.
error_reporting(0);

// Create an array, a cursor, count number of cols,
// perform the
fetch and insert in the array.
$results = array();
$ora_cur =
ora_do($ora_conn, $query);
// Don't panic, the $query will be set,
wait a bit :)

if ($ora_cur)
{
  // Number of cols
  $numCols
= ora_numcols($ora_cur);

  // Put the first line in the array...
  $row =
array();
  for($i=0; $i<$numCols; $i++)
  { // for
each column
   $row[ora_columnname($ora_cur,$i)] =
ora_getcolumn($ora_cur,$i);
  }
 
array_push($results,$row);

  // "Fetch" all records, one by one, and create an
array for each one.
  // Each array is "pushed" in the
$results array.
  while (ora_fetch($ora_cur))
  { //
for each record
   $row = array();
  
for($i=0; $i<$numCols; $i++)
   { // for each column
     $row[ora_columnname($ora_cur,$i)] =
ora_getcolumn($ora_cur,$i);
   }
   // Push
$results
   array_push($results,$row);
  }
}
// Now turns error_reporting on. Comment this line if you want
// to see "NO DATA FOUND" warnings.
error_reporting(1);
?>

?>

Ýyi Çalýþmalar
Ahmet DURUÖZ

> Linux üzerinde kurulu php ile nt üzerinde kurulu oracle
veri tabanýna
> baðlantýyý nasýl kurabilirim yardým eden olursa
çok memnun olurum.
>
>
_______________________________________________
>
Linux-programlama mailing list
>
Linux-programlama_at_liste.linux.org.tr
>
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>

_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Tue 23 Oct 2007 - 16:18:07 EEST

---------

Bu arsiv hypermail 2.2.0 tarafindan uretilmistir.