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
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?

Link to comment
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?

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 ?

 

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.