Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Calling Oracle Procedure from PHP Scripts

Posted on 2003-03-01
5
Medium Priority
?
249 Views
Last Modified: 2013-12-12
Hi ...
Can you help me about calling Oracle procedure from PHP scripts?

Thanks
0
Comment
Question by:Hytham
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
dboeke earned 150 total points
ID: 8054240
Here is a sample of how to do it:

<?
 $conn = ocilogon("scott","tiger","ORCL");
 $theNumber= 12345;
 $theDate = date(d."/".m."/".Y);
 $query = ("BEGIN MY_STORED_PROC (:SEQ_NUMBER, :SYSDATE); END;");
 $stmt = OCIParse($conn,$query);
 OCIBindByName($stmt, ":SEQ_NUMBER", &$theNumber,5);
 OCIBindByName($stmt, ":SYSDATE", &$theDate , 10);  
 OCIExecute($stmt);
?>


0
 

Author Comment

by:Hytham
ID: 8056125
Thanks a lot,

Actually, I am using the Oracle Functions located in the following link: http://www.php.net/manual/en/ref.oracle.php
not the OCIOracle Functions.
Is it a way to do the above simple example by Oracle Functions of PHP, or, I must use OCI to do that?

Thanks again

Hytham
0
 
LVL 2

Expert Comment

by:dboeke
ID: 8056786
What oracle version are you using?
0
 

Author Comment

by:Hytham
ID: 8062736
Oracle Version (9i) 9.2.0.1.0
0
 
LVL 2

Expert Comment

by:dboeke
ID: 8068209
you should be using the oci functions:  http://www.php.net/manual/en/ref.oci8.php the oracle functions you referenced were for pre oracle 8, the oci support 7.x, 8.x, and 9.x


0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question