how to display success message for connection to db?
Posted: Tue Jun 22, 2010 3:45 pm
Hi,
I'm working with a form and database and having troubles. The main issue is that I'm getting a blank white page with no errors. How can I tell php to output errors to let me know if I'm connecting to the database or not.
I have this
But the problem is that I have other issues that are giving me a blank page and I want to see a success message not just a failed message. At least that way I know for certain that the connection is being made.
I tried this
But still get the blank page. no failed or success message.
I'm working with a form and database and having troubles. The main issue is that I'm getting a blank white page with no errors. How can I tell php to output errors to let me know if I'm connecting to the database or not.
I have this
Code: Select all
$con = mysql_connect($host, $username, $password)or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
I tried this
Code: Select all
if (!$con){
$message = "no connection";
}
else{
$message = "success";
}
echo $message;