Re: PHP Oracle connection across page.
| From: | Muhammed Mamedov | Date: | Wed, 10 Sep 2003 22:31:35 +0000 |
| Subject: | Re: PHP Oracle connection across page. | ||
| References: | 1 | Groups: | php.db php.db |
| Request: | Send a blank email to php-db+get-30442@lists.php.net to get a copy of this message | ||
eventhough I've never used Oracle with PHP here is my suggestion:
create a file that will have your DB connection strings and include it in
every PHP file which uses Oracle connection.
EXAMPLE:
------------------------
[dbCon.php] file
$o_connection=@OCIlogon($o_conn_vars["username"], $o_conn_vars["password"],
$o_conn_vars["db"]);
[myPhpFile.php]
include_once("dbCon.php");
//Write youe queries now.
--
Muhammed Mamedov
Software Engineer
YTM.com.tr
"Syho" <syho@hkuspace.hku.hk> wrote in message
news:20030906030032.2355.qmail@pb1.pair.com...
> I have the following problem, please help me. Many thanks.
>
> Script 1:
> <?php
>
> $o_connection=@OCIlogon($o_conn_vars["username"],
$o_conn_vars["password"],
> $o_conn_vars["db"]);
>
> //Parse sql statement
> //Execute sql statement.
> ..
> ...
>
> require('2.inc');
>
> ?>
>
____________________________________________________________________________
> ___________
>
> 2.inc:
>
> // This script will switch the brower to script2.php
>
> <html>
>
> <form name="s_form" action="script2.php" method ="POST">
>
>
> </html>
>
>
____________________________________________________________________________
> ____________
>
> script2.php:
>
>
> <?php
>
> My problem is, how to get back the Oracle database connection in this
> script? Please advise.
>
> ?>