Hi,
How do we connect a Oracle Remote server using php. Can we pass hostname,port,db,username,password into the oci_connect() function?
As per oci_connect() syntax is seems to be not possible , is there any way to connect remote oracle server?
Thanks
15 9920
Have a look at the oracle instant client.
Have a look at the oracle instant client.
Yes I am trying through it but not yet become success. If you have any stuff to work with instant client please refer the url.
Thanks
Did you try
http://www.oracle.com/technology/pub/notes/technote_php_instant.html
Did you try
http://www.oracle.com/technology/pub/notes/technote_php_instant.html
No i have not come across this , i will workout on this and get back to you .
Thank You
Did you try
http://www.oracle.com/technology/pub/notes/technote_php_instant.html
Thank You Very much Now i am able to connect Remote Oracle Server and able to handle data.
That's good news. Good luck with the rest of it.
Hi,
I have connected my Remote Oracle Server through Oracle Instance Client, every thing was going fine. But now i am facing a serious problem like " I am getting same output in three different queries". Each query is fetching data from different oracle views. I am using three different php files for each query.
Even i have used oci_new_connect () in each php file for establishing a new connection but no use.
I am also using oci_parse(),oci_execute() to create a statement and execute statements.
At the end i am also using oci_free_statement(),oci_close() functions to free the result set as well as close the connection.
Finally i am trying to include three php files in a single php file to display the output and find "same output from three different files is being displayed".
I have tried by best and unable to find where the things are going wrong.
Please have a look at this and suggest me to resolve this problem.
Thank You
Hi,
This is in addition to my previous reply i have noticed one thing while investigating the case again "First Statement's result is being appended to the next statement and First and Second Statement's result being appended to the third statement. So any is there any solution to flush memory to avoid this while executing multiple statement's in php.
Thanks
Would be very useful if you post the code you are using.
Hi,
I have attached a code.zip file which contains 4 files including one index.php and three files where the script is available.
In my oracle database i have three different views which you can find out in my SQL statement.
Thank You
Better post the code itself here. Most people don't like downloading unknown zip files. Just post the relevant parts of the code here using code tags.
index.php -
<div id="main">
-
<div id="second">
-
<p class="yesday">IF YOU FORGOT YESTERDAY</p>
-
<HR>
-
-
<marquee onmouseover="this.stop()" onmouseout="this.start()" scrollamount="4">
-
<div class="ybday"><?php include 'yesday.php';?></div>
-
<BR>
-
</marquee>
-
-
<p class="today">JUST TO REMIND YOU TODAY</p>
-
<HR>
-
<marquee onmouseover="this.stop()" onmouseout="this.start()" scrollamount="4">
-
<div class="bday"><?php include 'today.php';?></div>
-
<BR>
-
</marquee>
-
-
<p class="tmrow">DONT FORGET TOMORROW</p><HR>
-
<marquee onmouseover="this.stop()" onmouseout="this.start()" scrollamount="4">
-
<div class="tobday"><?php include 'tmrow.php';?></div><br>
-
</marquee>
-
</div>
tmrow.php -
<?
-
$connm = oci_new_connect('username', 'password', 'mydb');
-
$error='Unable to Connect DataBase';
-
if (!$connm)
-
{
-
echo $error;
-
}
-
$gapa='No Occasions !';
-
$birthday='Birthday';
-
$wedding='Marriage Anniversary';
-
$gap='::';
-
-
$stmtm = oci_parse ($connm, "SELECT NAME ,MARRIAGE,BIRTH FROM SOCIAL_CAL_TOMORROW_EVENTS ORDER BY MARRIAGE,BIRTH " );
-
oci_execute ($stmtm);
-
-
if(oci_num_rows($stmtm)>0)
-
{
-
$display_stringb .= "$gapa";
-
}else
-
{
-
-
while ($resultm = oci_fetch_array($stmtm))
-
{
-
if($resultm['BIRTH']=='B')
-
{
-
$display_stringb .= $birthday;
-
}
-
if($resultm['MARRIAGE']=='M')
-
{
-
$display_stringb .= $wedding;
-
}
-
-
-
$display_stringb .= "$gap";
-
-
$display_stringb .= " $resultm[NAME] ";
-
-
$display_stringb .= "$gap";
-
}
-
}
-
echo "<font color= #0259A9 size=2em face=verdana>" .$display_stringb;
-
oci_free_statement($stmtm);
-
oci_close($connm);
-
?>
today.php -
<?
-
$conn = oci_new_connect('username', 'password', 'mydb');
-
$error='Unable to Connect DataBase';
-
if (!$conn)
-
{
-
echo $error;
-
}
-
$gapa='No Occasions !';
-
$birthday='Birthday';
-
$wedding='Marriage Anniversary';
-
$gap='::';
-
-
$stmt = oci_parse ($conn, "SELECT NAME ,MARRIAGE,BIRTH FROM SOCIAL_CAL_TODAY_EVENTS ORDER BY MARRIAGE,BIRTH " );
-
oci_execute ($stmt);
-
-
if(oci_num_rows($stmt)>0)
-
{
-
$display_stringb .= "$gapa";
-
}else
-
{
-
-
while ($resultt = oci_fetch_array($stmt))
-
{
-
if($resultt['BIRTH']=='B')
-
{
-
$display_stringb .= $birthday;
-
}
-
if($resultt['MARRIAGE']=='M')
-
{
-
$display_stringb .= $wedding;
-
}
-
-
$display_stringb .= "$gap";
-
-
$display_stringb .= " $resultt[NAME] ";
-
-
$display_stringb .= "$gap";
-
}
-
}
-
echo "<font color= #0259A9 size=2em face=verdana>" .$display_stringb;
-
oci_free_statement($stmt);
-
oci_close($conn);
-
?>
yesday.php -
<?
-
$conny = oci_new_connect('username', 'password', 'mydb');
-
$error='Unable to Connect DataBase';
-
if (!$conny)
-
{
-
echo $error;
-
}
-
$gapa='No Occasions !';
-
$birthday='Birthday';
-
$wedding='Marriage Anniversary';
-
$gap='::';
-
-
$stmty = oci_parse ($conny, "SELECT NAME,MARRIAGE,BIRTH FROM SOCIAL_CAL_YESTERDAY_EVENTS ORDER BY MARRIAGE,BIRTH " );
-
oci_execute ($stmty);
-
-
if(oci_num_rows($stmty)>0)
-
{
-
$display_stringb .= "$gapa";
-
}else
-
{
-
-
while ($resulty = oci_fetch_array($stmty))
-
{
-
if($resulty['BIRTH']=='B')
-
{
-
$display_stringb .= $birthday;
-
}
-
if($resulty['MARRIAGE']=='M')
-
{
-
$display_stringb .= $wedding;
-
}
-
-
-
$display_stringb .= "$gap";
-
-
$display_stringb .= " $resulty[NAME] ";
-
-
$display_stringb .= "$gap";
-
}
-
}
-
echo "<font color= #0259A9 size=2em face=verdana>" .$display_stringb;
-
oci_free_statement($stmty);
-
oci_close($conny);
-
?>
Do needful
Thank You
naveenkongati, as you will see I have formatted the code you posted. It is one of the Forum Guidelines that users use [code] tags when they post code. It makes it easier for our experts to read, and will, therefore, raise the chances of a solution.
If you are unsure how to do this, please read the Posting Guidelines.
Thankyou,
Moderator.
Those includes that you have all over the place are just doing their job. That's why the results appear to be appended.
Please tell me if any solution is there for this ? Can I go for a Ajax call ?Any other way to flush the statement before executes new statement?
Thank You
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Yanick Quirion |
last post by:
Hi all,
I'm trying to find a simple code to connect to an Oracle Database (9i) with
C under linux.
I have a script that read a form from the...
|
by: baumann.Pan |
last post by:
Dear all ,
how can I connect to oracle database in C language under linux? thanks in advance
|
by: youbay2001 |
last post by:
plz can any body tell me how to make the connect between oracle developer
forms 6i with mysql
thank for you ,
|
by: minhnguyen19 |
last post by:
I use Oracle 9i release 9.0.1.1
I want to connect Oracle with C# by OCI, but I can't add reference to using OCI.dll?
What should I do???
|
by: gobirahul |
last post by:
Hi Freinds,
please, let me know if u have any idea
How Can connect Oracle DB to Microsoft Access????
i have the oracle DB but want get this tables...
|
by: karan8985 |
last post by:
i can not connect the windows services with oracle. i did check all the privilages of oracle and NTFS permissions also ..but still i cant connect...
|
by: dounax |
last post by:
Hello,
I want to connect to an Oracle 9.2 database from a web site.
- I have created a DSN file, I access the database from Excel
- I have...
|
by: sindhujanan |
last post by:
hai,
anyone plz tell the code to connect oracle using database
|
by: techquest |
last post by:
Hi,
I want to connect into oracle database and export the table data into a flat file using UNIX shell scripts. I cant use other GUI tools to do...
|
by: kprawin |
last post by:
I've developed web applications using php and MySQL. Currently I wish to migrate towards oracle. And I need the steps to connect Oracle10g with PHP....
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
| |