473,509 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make PHP NOT consume OCI8 Errors.

dlite922
1,584 Recognized Expert Top Contributor
Hey Guys,

I'm finding that oci_error always returns false. When I did a test script:

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. $db = ocilogon('test', 'test', '//test:123/test.world');
  4. $stmntID = oci_parse($db, "SELECT dec2hex(14 FROM dual");
  5. oci_set_prefetch($stmntID, 1000);
  6. $result = oci_execute($stmntID,OCI_COMMIT_ON_SUCCESS);
  7. $data = oci_fetch_assoc($stmntID);
  8. var_dump(oci_error($db));
  9.  
  10.  
I get PHP warnings. Of course if you have errors turned off you never see the errors.

Reason I needed is I need to display a message to the user if a certain ORA-XXXXX error occurs. I can't do that because oci_error always returns false. ALSO oci_execute returns false.

This is not right. is it?

My only solution at this point is to capture any and all PHP warnings and see which one starts with ORA-XXX.

If someone can "edumicate" me I'd appreciate it.

Thanks,


Dan
Apr 6 '11 #1
2 2522
dlite922
1,584 Recognized Expert Top Contributor
EDIT: Disregard, see next message.

Commenting the line oci_set_prefetch() seems to make it work (although i'm using CodeIgniter and still having issues with it) but the test script above now displays the ORA error.

BUT I don't understand why that would erase the oci_error()? PHP DOCS make no mention of it that I see.

any clues?
Apr 6 '11 #2
dlite922
1,584 Recognized Expert Top Contributor
DISREGARD last Message:

It seems that different ORA- errors get reported in oci_error(), but ALL errors are reported to PHP as a warning.

This SQL will be caught in oci_error:

Expand|Select|Wrap|Line Numbers
  1. SELECT ' FROM dual; 
  2.  
  3. //ORA-01756: quoted string not properly terminated
  4.  

This will not:
Expand|Select|Wrap|Line Numbers
  1. SELECT dec2hex(14 FROM dual; 
  2.  
  3. //ORA-00907: missing right parenthesis
  4.  
Weird! What's so significantly different about them?

Any ideas?
Apr 6 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3005
by: lok | last post by:
hi all, i have installed oracle9i client tools on RedHat7.3 (x86 machine) and i compiled php4.1.2 & apache1.3 successfully but when i execute php script in browser, error occured: "Fatal error:...
0
1870
by: yzzzzz | last post by:
Hi, I am compiling PHP 5.0.2 myself with MySQL support. I did a ./configure --with-mysqli=/usr/local/mysql/bin/mysql_config (see end of post for complete configure) Note: I also have...
21
6199
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your...
6
6320
by: DravenStone | last post by:
Hi, I had just a horrible day at work, spent pretty much the entire day trying to get php_oci.dll and php_oracle.dll to load. It still never did. Super Quick Background. Jack of all trades IT...
2
1460
by: RC | last post by:
By default PHP always supports MySQL. But all our database servers are PostgreSQL or Informix. Order for me get PHP supports other than MySQL. I need download PHP source codes and compiled it...
5
2856
by: Mladen Gogala | last post by:
The latest version of OCI8 1.2.1 doesn't work with LOB fields. There was an open bug, but Tony2001 was his usual helpful self, so he removed the bug and flatly denied its existence. I had to...
5
8141
by: danish | last post by:
I download the oci-1.2.2.tgz file and generated the oci8.so file. After adding the extension=oci8.so in php.ini I get the error unable to load dynamic library /usr/lib/php4/oci8.so
0
4761
by: Yannick | last post by:
Hi, I'm Julien from France, We have recently install a new Web Server for my company The server is composed : - Linux RedHat RHEL4 U4 - Httpd-2.0.52-27.ent - Oracle Database 10.2.0.1
0
1098
by: ge0193387 | last post by:
I'm attempting to make a custom control that will let me drag drop images onto a web form and display the image in that same box. Any details on how to make that easier without turning me to a...
5
476
by: PG | last post by:
I am trying to compile a simple ODBC and C example on Windows XP SP2. I have Cygwin_NT 5.1. This is the code (obtained from...
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.