Re: PHP and MySQL question...
| From: | Evan Klinger | Date: | Sun, 09 Apr 2000 01:38:55 +0000 |
| Subject: | Re: PHP and MySQL question... | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-17752@lists.php.net to get a copy of this message | ||
Fraser MacKenzie wrote:
>
> Folks, I am using PHP and mysql for a site, and when I do a mysql_connect
> (for most pages) if it succeeds I want to continue onwards. If it fails
> then I want to locate to a 'Site Maintenance in Progress page'. However,
> the problem seems to be that as soon as the connect fails the following
> error message is pumped out to stdout:
>
> 'Warning: MySQL Connection Failed: Access denied for
> user: 'yyyyy@xxxxxx.com' (Using password: YES) in /pub/inc/db.inc on line
> 49
>
> Now, as soon as this is sent to stdout, I can no longer use:
>
> Header ("Location:
> http://www.xxxxxx.com/maintenance.html");
>
> Is there any way to disable the outputing of the warning message from
> mysql? Is this something I should be sending to the mysql mailing list?
>
> Thanks in advance for your time and trouble....
Proceed the mysql_connect() call with an '@'. This will disable the
output of the mysql_connect() function so you can then use the header()
function to redirect. Hope this helps.
--
ev
----------------------------
Evan Klinger evan@php.net
AIM evan715