Re: php5/oci8/oracle 11g1 insert doesn't work
| From: | Chris | Date: | Sun, 23 Nov 2008 22:41:21 +0000 |
| Subject: | Re: php5/oci8/oracle 11g1 insert doesn't work | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45698@lists.php.net to get a copy of this message | ||
Fred Silsbee wrote:
--- On Sun, 11/23/08, Chris <dmagick@gmail.com> wrote:Because you had a parse error and you most likely have all display_errors and other such useful things turned off. Save this code to a file. From the command line run: php -l filename.php (that's an "L" not a one). You will see: $ php -l test.php Parse error: syntax error, unexpected T_LNUMBER in test.php on line 21 Errors parsing test.php -- Postgresql & php tutorials http://www.designmagick.com/From: Chris <dmagick@gmail.com> Subject: Re: [PHP-DB] php5/oci8/oracle 11g1 insert doesn't work To: fredsilsbee@yahoo.com Cc: php-db@lists.php.net Date: Sunday, November 23, 2008, 9:43 PM Fred Silsbee wrote:the code works now is the question why is there no display in the browser when the sql is bad?The following code doesn't do the insert. As is the connect message doesn't show. I've tried the insert statement in a session: [oracle@LMKIII log_book]$ sqlplus landon/rumprocella SQL*Plus: Release 11.1.0.6.0 - Production on Sat Nov22 16:01:39 2008Copyright (c) 1982, 2007, Oracle. All rightsreserved.Connected to: Oracle Database 11g Enterprise Edition Release11.1.0.6.0 - ProductionWith the Partitioning, OLAP, Data Mining and RealApplication Testing optionsSQL> select * from log_book whereactype='B-17';no rows selected SQL> quit Disconnected from Oracle Database 11g EnterpriseEdition Release 11.1.0.6.0 - ProductionWith the Partitioning, OLAP, Data Mining and RealApplication Testing options<?php // File: anyco.php require('anyco_ui.inc'); $db = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT= 1521))(CONNECT_DATA ='rumprocella',$db))(SERVER = DEDICATED) (SID = LMKIIIGDNSID)) )"; if ($conn=oci_connect('landon',{ echo "Successfully connected toOracle.\n";// OCILogoff($conn); } else { $err = OCIError(); echo "Oracle Connect Error " .$err['message'];} // the connect shows a connect if I comment out thefollowing statements$stid = oci_parse($conn, 'insert into log_bookvalues ( TO_DATE('08/12/1973','MM/dd/YYYY'),'B-17','N5787G',1,1.8);');$r = oci_execute($stid );RTFM. $err = OCIError($r); echo "Oracle insert error " . $err['message']; -- Postgresql & php tutorials http://www.designmagick.com/