Ive tested these pages locally on our server and they work fine but after uploading them to our web server they don't execute but produce this error message:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'root@localhost' (Using password: NO) in /disk1/home3/mindseye/public_html/elearningcourses.php on line 47
Couldn't connect to server.
Here is my code:
[/php
<?php
$user = "";
$host = "localhost";
$password = "";
$connection = mysql_connect($host, $root, $password) or die ("Couldn't connect to server.");
$database = "courses";
$db = mysql_select_db($database) or die ("Couldn't select database.");
$sql = "SELECT coursename, briefdesc, accreditingbody FROM trainingtopics WHERE elearning = 'yes' ORDER BY coursename";
//echo $sql."<br>";
$result = mysql_query($sql) or die(mysql_error());
echo $result."=result<br>";
while($row=mysql_fetch_array($result))
{ // NOTE this one ABOVE the echo
//echo "result found!";
//echo $row[0];
echo '<a href="details.php?course=', urlencode($row[0]), '">',$row[0],'</a><br><br>';
echo $row[1],'</a><br><br>';
}
?>
]
This is hte first time ive uploaded php pages live on our site so how do I get them to function correctly? Thanks in advance