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 10066
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 web and I want to access my Oracle
database with...
|
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 in Microsoft Access.
Its urgent....
|
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 please give me solution,
thanks...
|
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 written the following vbScript, that works:
...
|
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 this, as the dataload will be in millions. hence if...
|
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. Since Im new to oracle please provide sample code...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |