chombone Posted April 24, 2007 Share Posted April 24, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/48514-solved-unable-to-connect-but-die-gives-no-error-message/ Share on other sites More sharing options...
chombone Posted April 24, 2007 Author Share Posted April 24, 2007 Gah! I had to restart Apache after I added MySQL!!! I knew it would be something stupid! Quote Link to comment https://forums.phpfreaks.com/topic/48514-solved-unable-to-connect-but-die-gives-no-error-message/#findComment-237361 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.