ok, i am having problems connecting to a database. i need help please
here is the code
[code=php]
<?
$host =”localhost”;
$username =”silvapro_franknu”;
$password =”abc123″;!
$database =”silvapro_prueba”;
// artist..
$artist_name = addslashes($artist_name);
$artist_release= addslashes($artist_release);
$artist_bio = addslashes($artist_bio);
$artist_news= addslashes($artist_news);
$artist_extra= addslashes($artist_extra);
$artist_picture= addslashes($artist_picture);
$db=mysql_connect (‘$host’, ‘$username’, ‘$password’) or die (‘I cannot connect to the database because: ‘ . mysql_error());
if(!$db)
{
echo ” Error: could not connect to database.”;
}
//business owner
$sql=”INSERT INTO `artist`(`artist_name`,`artist_release`,`artist_bio`,`artist_news`,`artist_extra`, `artist_picture`)
VALUES (‘”.$artist_name.”‘,'”.$artist_release.”‘,'”.$artist_news.”‘,'”.$artist_extra.”‘)”;
$result = mysql_query($sql);
echo mysql_error();
if($result)
{
echo mysql_affected_rows().” .artist information Inserted. <br>”;
}
?>
the display i am getting is
Error: could not connect to database.
can anyone help and tell me why is not working