It doesn't make any sense to me at all. The server that I have the script running on also contains the database. This is the error message in full:
Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in d:userspositivepaukpublic_htmlArticles_main.php on line 6
couldn't connect to server
The code is totally right, I'm almost 100% sure. Here it is (with the user, password and database blanked out, which, by the way, are correct):
<?php
$user="FTPUSERNAME";
$host="localhost";
$password="FTPPASSWORD";
$database="FTPUSERNAME";
$connection=mysql_connect($host,$user,$password) or die ("couldn't connect to server");
$db=mysql_select_db($database,$connection) or die ("couldn't select database");
$query="SELECT * FROM tblArticles WHERE 1";
$result=mysql_query($query) or die ("Couldn't execute query.");
echo "<table cellspacing='15'>";
echo "<tr><td colspan='2'>Articles</td></tr>";
while ($row = mysql_fetch_array($result))
{
extract($row);
$ArticleFileName=$ArticleFileName.".html";
echo "<tr>n
<td><a href='$ArticleFilename'>$ArticleTitle</a></td>n
<td>$ArticleDate</td>n
</tr>n";
}
echo "</table>n"
?>
Any idea what the problem could be? Thanks!