i have created a database named:Rezgroup
and i have already developed some pages but i dont know what is the code to connct Php and oracle.Thats why i can not access the database.
so far i have come up with the code is: - <?php
-
set conn=Server.CreateObject("ADODB.Connection")
-
conn.Provider="MSDAORA "
-
conn.Open "c:/webdata/Rezgroup"
-
set rs=Server.CreateObject("ADODB.recordset")
-
rs.Open "nwd_info", conn
-
-
?>
but i m not sure, is that correct or worong?.
can any body help me.
8 4532 pbmods 5,821
Recognized Expert Expert
Heya, Boss.
Please use CODE tags when posting source code:
[CODE=php]
PHP code goes here.
[/CODE]
You posted this in the Articles section. I'll go ahead and move it to the Forum where an Expert will be more likely to find it.
Note the language that I set on your code tags. The code you posted is not PHP.
hi,
i m not getting my solution. Is there any expert who can help me?
How to connect php with Oracle9i database?
--------------------------------------------------------------------------------
i have created a database named:Rezgroup
and i have already developed some pages but i dont know what is the code to connct Php and oracle.Thats why i can not access the database.
so far i have come up with the code is: -
<?php
-
set conn=Server.CreateObject("ADODB.Connection")
-
conn.Provider="MSDAORA "
-
conn.Open "c:/webdata/Rezgroup"
-
set rs=Server.CreateObject("ADODB.recordset")
-
rs.Open "nwd_info", conn
-
-
?>
-
but i m not sure, is that correct or worong?.
can any body help me.
Atli 5,058
Recognized Expert Expert
Hi.
That is not PHP code. It kind of looks like VB.NET code encapsulated in PHP tags.
Check out the Oracle Functions at PHP.net for an example of how to use PHP to connect to Oracle.
i m having a problem with database connectivity.i don't know whats code for connecting oracle9i database with php4.
is there any body to help me?
if possible also provide me the code for serial port reader by php.
Atli 5,058
Recognized Expert Expert
Hi.
You can check out the Oracle Functions at php.net for details on how to connect to oracle databases.
As for the serial port reader code. We are happy to help you fix any problems you may run into when writing the code yourself, but we will not write it for you.
pbmods 5,821
Recognized Expert Expert
Heya, Boss.
Keep posting duplicate threads, and I'll just keep merging them. You'll never get any help that way.
If you are using php to simply connect and select data would require this.
[PHP]
<?php
$conn = oci_connect('us ername', 'password', 'database');
if (!$conn) {
$e = oci_error();
echo htmlentities($e['message']);
exit;
}
$query = 'SELECT * FROM DEPARTMENTS';
$stid = oci_parse($conn , $query);
if (!$stid) {
$e = oci_error($conn );
print htmlentities($e['message']);
exit;
}
$r = oci_execute($st id, OCI_DEFAULT);
if (!$r) {
$e = oci_error($stid );
echo htmlentities($e['message']);
exit;
}
print '<table border="1">';
while ($row = oci_fetch_array ($stid, OCI_RETURN_NULL S)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?h tmlentities($it em):' ').' </td>';
}
print '</tr>';
}
print '</table>';
oci_close($conn );
?>
[/PHP]
Not my example got it from php.net :)
But look there for future reference first.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Kelly Carrigan |
last post by:
What combination of component versions is required to get Python,
DCOracle2, and an Oracle9i database on AIX 5.1 working together? It
seems that installing on AIX 5.1 with Oracle9i has at least two
challenges:
1. The libclntsh.so file doesn't exist and that file is referenced in
the installation. There is a libclntsh.a file but that is now what is
referenced.
2. The lib sub-directory is now the 64-bit Oracle distribution (don't
know if...
|
by: Oracle Instructor |
last post by:
Hi All,
Edmonds Community College is now offering the Oracle Development
Courses, which include Oracle9i SQL, Oracle9i PL/SQL, Oracle9i Forms,
and Oracle9i Reports. These courses will provide you with the skills
needed to pass the Oracle Certification tests. Because they are
credit classes (State Funded), you will save thousands of dollars by
taking these courses with Edmonds Community College.
Here are the Oracle courses that are...
|
by: aychai |
last post by:
Hi all,
I am trying to make use Oracle9i db to call an external .Net Web
Service from a JAva Stored Procedure.
I created the .Net Web Service and use JDeveloper 9.0.3.4Build(1247)
to create the Client Stub Java class(ie: serviceClientStub.java).
Following the instruction from the article"Calling External Web
Service from Java Stored Procedure",
|
by: Nathan Sokalski |
last post by:
When I attempt to run a form created with Oracle9i Forms Builder I receive a
dialog box asking for the following info:
User Name:
Password:
Database:
I obviously know my User Name and Password, and I assume that the value I
use for Database is the value found in the tnsnames.ora file (in my case,
ORCL). However, when I do this I receive the following error:
|
by: danbredy |
last post by:
Hi,
I'm attempting to connect to an Oracle database using SQL Server 2005
Express (OS is Windows XP Professional) and having absolutely no luck.
Here is the information SQL Plus
gives me about the database when I log in -
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
| |
by: SD007 |
last post by:
I am trying to connect Oracle9i with jdk1.4, but it is giving error at-
Class.forName("Oracle.jdbc.driver.OracleDriver");
The error is-
java.lang.ClassNotFoundException:Oracle.jdbc.driver.OracleDriver.
please help me.
|
by: gopiinamadar |
last post by:
hi
i want to connect a jsp file with oracle9i server.
initially i used MS Access with jsp and i will copy all jsp and html pages in webapp/root files and run apache tomacat5.5, it works fine..
but now i want to connect it with oracle9i server. so what i have to do or where i have to copy the files(jsp & html) or any other method?
please help me
thanks
|
by: eeriehunk |
last post by:
Hi, Please give me a lead on how to connect Oracle 9i which is on a unix machine to MS SQL Server and access its data. Does Oracle9i or TOAD have any inbuild functionality to make connections and access data.
|
by: samir pradhan |
last post by:
Hi Everybody. I am new in this forum.
can anybody help me to explain the connection procedure of oracle9i database and oracle 10g developer suite ?
Thanx
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |