Page 1 of 1

PHP Mysql connection failure?

Posted: Fri Oct 19, 2007 6:58 pm
by boagus1
Here is the code:

***** PLEASE USE

Code: Select all

AND OTHER TAGS WHEN POSTING CODE *****[/color]

Code: Select all

<?php
	

	$connection = mysql_connect("localhost", "root", "passio");
		if(!$connection) {
			die(Database connection failed; " . mysql_error());
	}
	
	
?>
<html>
<head>
<title>MsqlTry2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">

</body>
</html>

I have WAMP5 1.7.3 correctly configured. MySQL and PHPMyAdmin setup with my databases correctly.
DreamWearver is my editor and I have repeatedly run this simple code and I get nothing.
A blank browswer screen. The username is correct and the password is wrong.
It should fail but it's not giving the error message.
Even with the correct password, I can not tell if it connected or not.

Someone plesae help

Re: PHP Mysql connection failure?

Posted: Fri Oct 19, 2007 7:06 pm
by Christopher
boagus1 wrote:... I have repeatedly run this simple code and I get nothing.
A blank browswer screen.
Try adding this to the top of your script:

Code: Select all

error_reporting(E_ALL);

Posted: Fri Oct 19, 2007 7:12 pm
by boagus1
Still nothing but a blank browser screen

Posted: Fri Oct 19, 2007 8:40 pm
by gregwhitworth
This may be a dumb question, but where are your connection settings? Did you just delete them for this post, or is there really no connection settings.

--
Greg

Posted: Fri Oct 19, 2007 8:42 pm
by John Cartwright

Code: Select all

die(Database connection failed; " . mysql_error());
You are missing the opening quote ;)