Quick host alive check

This is a discussion on Quick host alive check within the alt.comp.lang.php forums, part of the PHP Programming Forums category; In an online submission for a quote we've had intermittent errors if the mysql server goes down. This errors ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-19-2004
john henry bonham
 
Posts: n/a
Default Quick host alive check

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?
Reply With Quote
  #2 (permalink)  
Old 10-19-2004
Virgil Green
 
Posts: n/a
Default Re: Quick host alive check

"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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:29 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0