WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : An example of querying an Oracle database from within a PHP3 script
Categories : Oracle, PHP Update Picture
Cary Collett
Date : Oct 23rd 1998
Grade : 1 of 5 (graded 3 times)
Viewed : 7571
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Cary Collett
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

It's not even that easy, you need to set up a few environment variables
as well. Here's what typically works for me, customize things to
fit your installation.

PutEnv("ORACLE_HOME=/export/home0/oracle7");
PutEnv("ORACLE_SID=<some db name here>");
PutEnv("ORA_NLS=/export/home0/oracle7/ocommon/nls/admin/data");
$conn_id = ora_plogon("<username>","<password>");
$cur = ora_open($conn_id);

ora_parse($cur, "SELECT * from session WHERE sessionid = '9087652'");
ora_exec($cur);
while (ora_fetch($cur) == 1) {
$sessionid = ora_getcolumn($cur, 0);
$username = ora_getcolumn($cur, 1);
$firstname = ora_getcolumn($cur, 2);
$lastname = ora_getcolumn($cur, 3);
$phone = ora_getcolumn($cur, 4);
...
}

I haven't done much with Oracle in PHP3 so there are probably spiffier
ways for fetching the columns and rows, but this should get you started
at least.

> How will PHP/Oracle deal with the fact that the columns firstname &
> lastname are null?
>

Null columns come into PHP as empty strings ( "" ) I believe.



PHP CLASS for ORACLE (database connectivity)
Categories : PHP, PHP Classes, Classes and Objects, Databases, Oracle
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Ora_Bind -- bind a PHP variable to an Oracle parameter
Categories : PHP, PHP Functions, Oracle
StoredProcedure, Stored Procedure, Oracle, OCI8, OCI8i
Categories : OCI8, Oracle, Databases, PHP
Connecting to Oracle with php3
Categories : Oracle, PHP, Databases
A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, Oracle, PHP, Arrays, Variables
Simple class for accessing databases like MSSql Server, Oracle etc by Raju
Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle
normalize fields and strings used in where (command's Sql)
Categories : PHP, Databases, Oracle, Functions
Ora_CommitOn Ora_CommitOff commit rollback database SQL Oracle
Categories : Oracle, PHP
google like search function with bolded search terms
Categories : PHP, Search, Databases, General SQL
Parsing Simple Template Files and Data
Categories : PHP, PHP Classes, Templates, Regexps
webcam cam view image ispy browser independant
Categories : Graphics, HTML, HTML and PHP, PHP
sesam_affected_rows -- Get number of rows affected by an immediate query
Categories : PHP, PHP Functions, SESAM
Is there some possibility to link a database to an htaccess file, so that instead of having a passwd file you would have a database with DES-crypted password and username fields?
Categories : Authentication, PHP, General SQL, Databases
PHP, simple, counter, bala
Categories : HTML and PHP, PHP, PHP Options and Info