<?PHP
// In diesem Beispiel wird beschrieben wie man eine StoredProcedure aufruft,
// einen Integer bergibt und diesen wieder ausgibt.
// Oracle Client mu installiert sein und die extension php_oci8 mu installiert sein!
// Bei dem Beispiel: ps
// Host-Name: rechner
// Port-Nummer: 1521
// Variablen
$usr = "Dein User";
$pwd = "Dein Passwort";
$sid = "Dienstname";
// Verbindung zum Oracle-Server herstellen
$conn = OCILogon ($usr, $pwd, $sid);
// SoredProcedure t_phpsaveproc(integer) aufrufen
$stmt = OCIParse($conn, "begin :result := t_phpsaveproc(1); end;");
// OCIBindByName bindet die Variable result an den Platzhalter $result
OCIBindByName($stmt, "result", &$result);
// Commit, hier werden die "Jobs" ausgefhrt.
OCIExecute($stmt);
// Mit OCIResult wird der Rckgabewert der StoredProcedure aus der Menge in die PHP-Variable $result
geschrieben
OCIResult($stmt,$result);
// Ausgabe des Rckgabewertes
echo $result;
// Verbindung zum Oracle-Server schlieen
ocilogoff($conn);
?>
Simple class for accessing databases like MSSql Server, Oracle etc by Raju Categories : PHP , MS SQL Server , Databases , PHP Classes , Oracle 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 get de errror message to access the database Categories : PHP , OCI8 , Databases normalize fields and strings used in where (command's Sql) Categories : PHP , Databases , Oracle , Functions Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0. Categories : Databases , PHP , mSQL , Databases PHP CLASS for ORACLE (database connectivity) Categories : PHP , PHP Classes , Classes and Objects , Databases , Oracle This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases , MySQL , Complete Programs , PHP , Databases MySQL Connection/Query Class Categories : Databases , MySQL , PHP , PHP Classes Checks Date-Input from HTML-Forms and converts to YYYY-MM-DD Format for MySQL Date-Fields Categories : MySQL , Date Time , PHP , Databases Query Timer Categories : PHP , Databases , Date Time PHP and MySQL scripting for Muyltiple CheckBoxes Categories : HTML and PHP , MySQL , Databases , PHP Phorum, MySQL, Language, UK date format, MySQL UK Date format Categories : PHP , Date Time , Strings , MySQL , Databases Implementing a Members ONLY area Categories : PHP , MySQL , Databases , Authentication This is a database wrapper for PostgreSQL, but can be simply modified for any other database type. Categories : Databases , PostgreSQL , PHP
Laurence Veale wrote : 666
Is this actually a stored procedure or a function?
I can call procedures no problem, but I`m not having any luck calling a function that returns a value to a PL/SQL variable.
How do I do the PHP equivalent of the following in PL/SQL...
DECLARE
answer NUMBER;
BEGIN
Answer:=package.function1(1500,`10-JUN-2001`,`23-JUL-2001`);
DBMS_OUTPUT.Put_Line(`The answer is: ` ||Answer);
END;