Error: Lost Connection

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Rupo
Forum Commoner
Posts: 25
Joined: Thu Jul 05, 2007 11:22 am

Post by Rupo »

test-script

Code: Select all

error_reporting(E_ALL|E_STRICT);
define('host','xxx');
define('user','xxxx');
define('pass','xxx');
define('name','xxx');

$db=mysql_connect(host, user, pass);
mysql_select_db(name, $db) or die(mysql_error());

$sql="SELECT * FROM NEWS";
$result=mysql_query($sql,$db);
$return=mysql_fetch_array($result);
print_r($return);
echo '<br>';
echo phpversion();
causes the following error
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /var/www/web2/html/test.php on line 8

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /var/www/web2/html/test.php on line 9
Lost connection to MySQL server during query
to my opinion, there definitely no connection
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

So... It verifies your credentials, but then "loses" the connection? Yeah, that's extremely odd. I'd speak to the host about their database and get them to PROVE that it's something wrong on your end.
Post Reply