Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle/PHP Question
Hi
Look at a tutorial at: http://www.awtrey.com/support/dbeweb/
There is an example for Oracle too:
http://www.awtrey.com/files/php/guest_oracle.txt
Main points are here:
This is the SQL statement to create the database required for this application.
CREATE TABLE GUESTS (
GUEST_ID NUMBER (4) NOT NULL, GUEST_NAME VARCHAR2 (50), GUEST_EMAIL VARCHAR2 (50), GUEST_TIME DATE, GUEST_MESSAGE VARCHAR2 (2000),
CREATE SEQUENCE GUEST_ID_SEQ
START WITH 0
INCREMENT BY 1
MINVALUE 0
NOCACHE
NOCYCLE ;
<?
////////////////////////////////
////////////////////////////////
////////////////////////////////
////////////////////////////////
$stmt = ociparse($c1,$query);
OCIexecute($stmt,OCI_DEFAULT);
OCIFreeStatement($stmt);
OCICommit;
?>
Kari
(Mr.) Kari Pannila
Oracle DBA (OCP)
TietoEnator Corp - Telecom
Delete X to get a correct mail address ( X is only for the SPAMMERS ).
phurley_at_austin.rr.com wrote:
> Does anyone have suggestions regarding this question: > > Oracle auto sequence insert. Using PHP and Oracle, I would like to be > able to insert a row and have the sequence automatically inserted with > directly referring to sequencename.nextval in the insert. > > How can I go about setting up the table/trigger/whatever is needed to > automatically insert the next sequence, much like AutoNumber in access > and identity in SQL server. Also, how would I retrieve the inserted > id after the insert, to use it as a foreign key and such for another > table. > > Thanks, > > ph.Received on Thu Apr 20 2000 - 00:00:00 CDT
![]() |
![]() |