how to hide an error message

Somewhere in my homepage I offer acces to a database. Using php all
works fine, mostly. I'm using die() with an appropriate message in
case the server is down or something is wrong. So far, so good.
However, if there is something wrong I always get, prior to my own
message: Warning (and a text). This is very well and usefulwhen
preparing thins like this. But not always. I know there is a way to
hide these warnings, but I forgot. (I remember it's very simple too.)
Can anyone tell me?
Thanks in advance.
Anne
Anne Bos [ Mi, 01 November 2006 19:27 ] [ ID #1521007 ]

Re: how to hide an error message

> Somewhere in my homepage I offer acces to a database. Using php all
> works fine, mostly. I'm using die() with an appropriate message in
> case the server is down or something is wrong. So far, so good.
> However, if there is something wrong I always get, prior to my own
> message: Warning (and a text). This is very well and usefulwhen
> preparing thins like this. But not always. I know there is a way to
> hide these warnings, but I forgot. (I remember it's very simple too.)
> Can anyone tell me?

you can suppress an error message by placing an [at] in front of the function
for example [at] mysql_connect()
Peter [ Mi, 01 November 2006 20:35 ] [ ID #1521008 ]

Re: how to hide an error message

peter wrote:
>> Somewhere in my homepage I offer acces to a database. Using php all
>> works fine, mostly. I'm using die() with an appropriate message in
>> case the server is down or something is wrong. So far, so good.
>> However, if there is something wrong I always get, prior to my own
>> message: Warning (and a text). This is very well and usefulwhen
>> preparing thins like this. But not always. I know there is a way to
>> hide these warnings, but I forgot. (I remember it's very simple too.)
>> Can anyone tell me?
>
> you can suppress an error message by placing an [at] in front of the function
> for example [at] mysql_connect()
>
>

Also if you want to hide message but actually do something based on a
particular error message you can look at PHP manual, Exception Handling
in Chapter 10 for Try() Catch() processing...

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
____________________________________________________________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
IchBin [ Mi, 01 November 2006 22:46 ] [ ID #1521009 ]

Re: how to hide an error message

On Wed, 01 Nov 2006 16:46:08 -0500 wrote IchBin <weconsul [at] ptd.net>:

>peter wrote:
>>> Somewhere in my homepage I offer acces to a database. Using php all
>>> works fine, mostly. I'm using die() with an appropriate message in
>>> case the server is down or something is wrong. So far, so good.
>>> However, if there is something wrong I always get, prior to my own
>>> message: Warning (and a text). This is very well and usefulwhen
>>> preparing thins like this. But not always. I know there is a way to
>>> hide these warnings, but I forgot. (I remember it's very simple too.)
>>> Can anyone tell me?
>>
>> you can suppress an error message by placing an [at] in front of the function
>> for example [at] mysql_connect()
>>
>>
>
>Also if you want to hide message but actually do something based on a
>particular error message you can look at PHP manual, Exception Handling
>in Chapter 10 for Try() Catch() processing...

That's it, yesssss. Many thanks.
Anne Bos [ Do, 02 November 2006 00:05 ] [ ID #1521010 ]

Re: how to hide an error message

>>Also if you want to hide message but actually do something based on a
>>particular error message you can look at PHP manual, Exception Handling
>>in Chapter 10 for Try() Catch() processing...
>
> That's it, yesssss. Many thanks.

Just a note if you are going to use try and catch ensure you are using php 5
as it was a new feature in this version and is not available for php 4.x
Peter [ Do, 02 November 2006 11:32 ] [ ID #1522265 ]
PHP » alt.php.sql » how to hide an error message

Vorheriges Thema: Is This Possible?
Nächstes Thema: Using an IF statement