473,788 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to connect php with Oracle9i database?

45 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. set conn=Server.CreateObject("ADODB.Connection")
  3. conn.Provider="MSDAORA "
  4. conn.Open "c:/webdata/Rezgroup"
  5. set rs=Server.CreateObject("ADODB.recordset")
  6. rs.Open "nwd_info", conn
  7.  
  8. ?>
but i m not sure, is that correct or worong?.
can any body help me.
Oct 28 '07 #1
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.
Oct 28 '07 #2
boss1
45 New Member
hi,
i m not getting my solution. Is there any expert who can help me?
Oct 29 '07 #3
boss1
45 New Member
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:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. set conn=Server.CreateObject("ADODB.Connection")
  3. conn.Provider="MSDAORA "
  4. conn.Open "c:/webdata/Rezgroup"
  5. set rs=Server.CreateObject("ADODB.recordset")
  6. rs.Open "nwd_info", conn
  7.  
  8. ?>
  9.  
but i m not sure, is that correct or worong?.
can any body help me.
Oct 29 '07 #4
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.
Oct 29 '07 #5
boss1
45 New Member
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.
Nov 3 '07 #6
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.
Nov 3 '07 #7
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.
Nov 3 '07 #8
post
17 New Member
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):'&nbsp;').' </td>';
}
print '</tr>';
}
print '</table>';
oci_close($conn );
?>
[/PHP]

Not my example got it from php.net :)
But look there for future reference first.
Nov 3 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1416
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...
0
1951
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...
0
2218
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",
3
10986
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:
8
14376
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
0
959
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.
4
3221
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
4
2019
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.
1
4401
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
0
9498
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,...
0
10373
Oralloy
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...
0
10177
jinu1996
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...
0
8995
agi2029
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...
1
7519
isladogs
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...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
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
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.