Can't connect to Mysql database
Hello, My teacher has given me acess to his mysql db so I could do a project but I'm having trouble connecting to it.
here is the code that I'm using
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
// we connect to example.com and port 3307
$link = mysql_connect('db****.perfora.net ', 'dbo****** ', 'n****);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
// we connect to localhost at port 3307
$link = mysql_connect('**** ', 'db******, '*****');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
I used *'s so no one could get acess to it besides me