Jump to content

Getting feedback from code


Johng1010

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/230249-getting-feedback-from-code/
Share on other sites

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?

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 ?

 

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.