List:General Discussion« Previous MessageNext Message »
From:Jay Blanchard Date:March 8 2005 5:28pm
Subject:RE: php - mysql connection
View as plain text  
[snip]
I am a new mysql user.  I installed a MySQL, PHP and Apache on my
computer with Windows XP.
All my php scripts run fine unless I try to connect to mysql
 
<?php
echo "start here";
$a = mysql_connect("localhost", "test", "test");
echo $a;
echo "stop here";
?>  
 
I don't get any response even error message and page source looks like
 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
start here
 
I guess that I am doing something very stupid - still could anybody help
me?
[/snip]

Try this...

if(!($dbconnect = mysql_connect("localhost", "test", "test"))){
	echo mysql_error() . "\n";
	exit();
} 

It will give you a more descriptive error if there is one
Thread
php - mysql connectionStar Smile Center for Esthetic Dentistry8 Mar
RE: php - mysql connectionJay Blanchard8 Mar
  • Re: php - mysql connectionEric Bergen8 Mar