Thread: FIRST Topsite?
View Single Post
  #41   Spotlight this post!  
Unread 03-03-2005, 19:33
Calvin Calvin is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Portland OR
Posts: 105
Calvin has a spectacular aura aboutCalvin has a spectacular aura about
Re: FIRST Topsite?

Ok we just had one of those MySQL errors. The image thing worked (the error.gif) was displayed, but it slowed down the website a bit.

Here is the code used:

PHP Code:
mysql_connect($hostname,$username,$password);
if(
mysql_error() == "")
{
// Display the right image
}
elseif (
mysql_error() != "")
{
    
header("Location: " "http://franklin.f2o.org/topsite/error.gif" "");

It seems to be taking alot of time trying to connect... is there a faster way to try connect, and VERY fast say if there is a error or not?

hmmm how about:
PHP Code:
$link = @mysql_connect($hostname,$username,$password);
if (!
$link
{
       
header("Location: " "http://franklin.f2o.org/topsite/error.gif" "");

Would that speed it up, as far as testing goes?

Last edited by Calvin : 03-03-2005 at 19:39.