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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.