PHP Classes

"No connection" errors

Recommend this page to a friend!

      Ultimate MySQL  >  All threads  >  "No connection" errors  >  (Un) Subscribe thread alerts  
Subject:"No connection" errors
Summary:Random "No connection" errors
Messages:2
Author:Shadow aok
Date:2012-05-21 11:39:19
Update:2012-05-21 13:12:45
 

  1. "No connection" errors   Reply   Report abuse  
Picture of Shadow aok Shadow aok - 2012-05-21 11:39:19
Hello,

I'm using your class with Ubuntu 10.04 AMD64, PHP 5.3.2 and MySQL 5.1.62.
Thanks for sharing it.

I have a few PHP classes which herit from your class.

Sometimes I got some random "No connection errors" :

PHP Fatal error: Uncaught exception 'Exception' with message 'No connection (1514)' in /var/www/includes/class.mysql.php:1514\nStack trace:\n#0 /var/www/includes/class.mysql.php(1353): MySQL->SetError('No connection', -1)\n#1 /var/www/includes/class.group.php(311): MySQL->RowCount() ...

MySQL works fine and the request are fine, they just fail sometimes on RowCount.

Here's a part of one of my class :
class group extends MySQL
{
public function __construct()
{
parent::__construct();
}

public function __destruct()
{
parent::__destruct();
}

public function ...
{
$sql = "...";
parent::Query( $sql );

$rowCount = parent::RowCount();
if( empty( $rowCount ) )
{
return Error::cast ...
}

parent::MoveFirst();
$row = parent::Row();

...
}
}

Regards,

Shadok

  2. Re: "No connection" errors   Reply   Report abuse  
Picture of Shadow aok Shadow aok - 2012-05-21 13:12:45 - In reply to message 1 from Shadow aok
Basically, it happens when my request return only one result : 0 or 1 (tinyint).