For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > October 2004 > Quick host alive check









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Quick host alive check
john henry bonham

2004-10-19, 8:58 am

In an online submission for a quote we've had intermittent errors if the
mysql server goes down. This errors cause prices to display at £0.00

What's the best way to check the host is alive before the rest of the
code runs?
Virgil Green

2004-10-19, 3:55 pm

"john henry bonham" <with@he.ld> wrote in message
news:4174e983$0$94917$5a6aecb4@news.aaisp.net.uk...
> In an online submission for a quote we've had intermittent errors if the
> mysql server goes down. This errors cause prices to display at £0.00
>
> What's the best way to check the host is alive before the rest of the
> code runs?


I've often seen the suggestion to issue the query "select 1".

However, such a technique won't do you any good if the server goes down
right after than.

Nothing will beat basic error checking after each attempted database access,
coupled with appropriate error handling.

- virgil


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com