connect to mySQL database issue
Posted: Mon Jul 20, 2009 8:41 am
When I browse my website with the following code, my firefox browser will ask me whether I want to save my password and username.
Is this not the proper way to connect to a database then? Why would firefox bother the user to save my login data. Anyone know what I do wrong?
Thanks.
Is this not the proper way to connect to a database then? Why would firefox bother the user to save my login data. Anyone know what I do wrong?
Thanks.
Code: Select all
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (mysql_query("CREATE DATABASE my_db",$con))
{
echo "Database created";
}
mysql_close($con);
?>