Reply to Re: [PHP] Is this a mysql_connect() bug?

Your name:

Reply:


Posted by Tom Soyer on 01/30/05 06:50

Thanks for the error handling code. I think PHP still has a basic
problem. If mysql sever connection times out because wrong username or
password was used, then mysql_connect() should return FALSE. But this
is not the case, why? Is it possible that mysql_connect() could not
read the "connection failed" message from mysql server?


On Sat, 29 Jan 2005 23:01:46 -0500, trlists@clayst.com
<trlists@clayst.com> wrote:
> On 29 Jan 2005 tom soyer wrote:
>
> > I tried mysql_connect() function, and it won't reture FALSE if
> > connection failed. Instead, the script times out after 30 seconds and
> > displays an Fatal error message "Maximum execution time of 30 seconds
> > exceeded".
>
> I think the issue here is if the server does not respond it hits the
> execution time limit before the function returns.
>
> I use code like this:
>
> $olderr = error_reporting(0);
> set_error_handler('ignoreerrhandler');
> $dbHandle = mysql_connect($dbHost, $dbUser, $pw);
> restore_error_handler();
> error_reporting($olderr);
>
> .....
>
> function ignoreerrhandler($errno, $errstr, $errfile, $errline) {
> return;
> }
>
> You can also control the connection timeout with the
> mysql.connect_timeout setting in php.ini.
>
> --
> Tom
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация