Johng1010 Posted March 10, 2011 Share Posted March 10, 2011 Hi all I have just started with PHP I am using 5.2.5 and Apache 2.2.8 My problem is I am not getting anything back from my code to tell me what is happening Code is <?php $username = "root"; $password = ""; $hostname = "localhost"; //connection to the database echo '<p>Got Here</p>'; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); if (!$dbhandle){ echo '<p>Failed</p>'; } var_dump($dbhandle) ; print_r ($dbhandle); echo '<p>Got Here Two</p'; ?> All I get is the first echo nothing from the die or the if or var_dump or print_r I am used to being able to step through code line by line is there any software for PHP which will do this ? Alternatively can anyone say why I am getting no output TIA Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 10, 2011 Share Posted March 10, 2011 You are likely getting a fatal runtime error at the mysql_connect() statement because the mysql extension is not enabled. Are you doing this on a system with error_reporting set to E_ALL (or to a -1) and display_errors set to ON in your master php.ini so that all the errors that php detects will be reported and displayed? Quote Link to comment Share on other sites More sharing options...
Johng1010 Posted March 11, 2011 Author Share Posted March 11, 2011 You are likely getting a fatal runtime error at the mysql_connect() statement because the mysql extension is not enabled. Are you doing this on a system with error_reporting set to E_ALL (or to a -1) and display_errors set to ON in your master php.ini so that all the errors that php detects will be reported and displayed? Thanks for the reply You are correct display_errors was of so could not see runtime error. error_reporting is E_ALL in php.ini phpinfo() reports it as 6143 is this correct ? Quote Link to comment 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.