Jump to content

[SOLVED] unable to connect but die() gives no error message


chombone

Recommended Posts

I've just got a new machine so I've reinstalled Apache 2.2.3, MySQL 4.1.21 and PHP 5.2.0 and created my database on the new machine. I've also configured Apache and PHP.

 

I've added a user to MySQL using :

 

GRANT ALL

ON thedb.*

TO user@"localhost"

IDENTIFIED BY "password";

 

I'm running a PHP script :

 

<?php

  echo 'hello';

      $connection = mysql_connect("localhost","user","password") or die ("Could not connect: " . mysql_error());

  echo 'hello again';

      mysql_select_db("thedb",$connection) or die ("Could not select db: " . mysql_error());

  echo 'hello again2';

 

?>

 

The problem is, I get "hello", but no "hello again", no "hello again2"  and no mysql_error.

 

I expect it's configuration, but this works perfectly on my old machine and I'm tearing my hair out. PHP is working (the phpinfo script executes fine).

 

Any ideas appreciated.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.