note 9333 added to Error Control Operators

From: Date: Sat, 28 Oct 2000 10:02:06 +0000
Subject: note 9333 added to Error Control Operators
Groups: php.notes 
Request: Send a blank email to php-notes+get-7103@lists.php.net to get a copy of this message
@ sign saved me! I have used OCILogon() function to get a connection with a remote Oracle 8i server. If the database is donw for some reason, then I don't want lines of nasty messages generated directly by Oracle to pop up on my Web page. The following code is tested to be working on a Solaris box, where Apache 1.3.12 and PHP 4.0.3 are installed (Oracle server is on a True 64 box): if (!($conn = @OCILogon($username, $password,$sid))) { /* for whatever reason the connection fails, write out your own message here. */ echo("<p>Database connection failed. Please verify your username and password, then reconnect. If problem persists, please contact your Webmaster for assistance.</P>"); } else { /* if you're lucky, you can get a connection, then you should resume normal operation, such as record fetching, deploying etc. */ } http://www.php.net/manual/language.operators.errorcontrol.php

« previous php.notes (#7103) next »