Hi,
I am getting frustrated beyond belief at the moment with trying to get a very simple script to run, I am using PHP 5.3.3 and MySQL 5.1 on a Win2k8 server with IIS7.5. Basically my script is connecting to a local database, running a single select query, returning those rows and building up a string from them.
The problem is that I am receiving complete BS responses from PHP that the access is denied for the user being specified. This is complete rubbish since the user can connect via mysql, sqlyog, ASP.NET MVC without issue but for some bizarre reason it is not working via PHP.
The code for the script is here :
<?php
$mysql = mysql_connect('127.0.0.1:3306', 'myuser', 'mypass', 'mydatabase');
if (!$mysql) {
die(mysql_error());
$content = "<nobr></nobr>";
} else {
$result = mysql_query('SELECT * FROM tblEventGroup');
$content = "<nobr>";
if ($result) {
while($row = mysql_fetch_assoc($result)) {
$content .= "<span>";
$content .= $row['GroupName'];
$content .= "</span>";
$content .= "<a href=\"../Event/EventSearch?groupid=";
$content .= $row['GroupId'];
$content .= "\" target=\"_blank\">Book here</a> ";
}
}
mysql_close($mysql);
$content .= "</nobr>";
}
?>
I cannot for the life of me understand what the problem is, the return error is
Access denied for user 'myuser'@'localhost' (using password: YES)