Re: Oracle and PHP
| From: | Radovan Radic | Date: | Mon, 25 Aug 2003 14:40:51 +0000 |
| Subject: | Re: Oracle and PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30085@lists.php.net to get a copy of this message | ||
Hi Roger,
There is Oracle Commander , but it is not very good as phpMyAdmin. Try it:
http://www.bitesser.de/downloads/download.php?filename=oraclecommander
Oracle is similar to other databases used from PHP, only difference is
calling stored procedures that return resultset.
Dont use oracle functions, but oracle8 (oci) extension for Oracle, they are
better documented and easier to use.
There is PHP manual that can help you learn oracle+php. If u have some
questions you can ask here.
For example, there are couple of functions i wrote to myself:
Some ppl say you should put environment variables, before connecting:
putenv( "ORACLE_HOME=/usr/oracle/product/9.2.0" );
putenv("TWO_TASK=/usr/oracle/product/9.2.0/network/admin/tnsnames.ora");
putenv("TNS_ADMIN=/usr/oracle/product/9.2.0/network/admin");
putenv("ORACLE_SID=test");
$connection = OCIPlogon($user,$pass,$dbname);
function query($sql)
{
$query=OCIParse($connection,$sql);
if ($query)
OCIExecute($query);
return $query;
}
function query_fetch_array($query)
{
if (OCIFetchInto($query,$result,OCI_ASSOC+OCI_NUM+OCI_RETURN_NULLS))
{
return $result;
}
else
{
return 0;
}
}
$sql="select * from emp";
$query=query($connection,$sql);
while ($row=query_fetch_array($query))
{
// You can user $row["EMPNO"] or $row[0]...
}
Radovan
"Roger Spears" <roger@bgnet.bgsu.edu> wrote in message
news:3F462009.5000808@bgnet.bgsu.edu...
> Hello,
>
> I was wondering if there are any PHP people out there that are really
> into using Oracle databases? I've always used mysql but now I find
> myself in a situation that requires the use of an Oracle database.
>
> I've printed out the information posted by Thies C. Arntzen titled
> "Making Efficient use of Oracle8i thru Apache and PHP 4" but I was
> wondering if I may see some other code examples. Very basic examples
> dealing with connections, queries and the such. Also, is there an
> application for Oracle databases that is similar to PHPMyAdmin for mysql
> databases?
>
> Thanks,
> Roger
>
>