Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I used the following file below to test my connection to MySQL and have a wierd problem
<html>
<head>
<title>Test MySQL</title>
<body><table border="1">
<tr><td>Variable_name</td><td>Value</td></tr>
<?php
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo("<TR>");
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++) {
echo("<TD>" . $row_array[$j] . "</td>");
}
echo("</tr>");
}
?>
</table>
<?php } ?>
</body>
</html>That's the file, problem is when I set
$host="localhost";
$user="admin";
$password="";I get no errors in my browser and it displays the page correctly but if I put my password in the field then it displays this error :
Warning: mysql_connect(): Access denied for user: 'admin@localhost' (Using password: YES) in c:\inetpub\wwwroot\mysql_up.php on line 11
I have my password set and in the WinMySQL Console in the my.ini file I can see my credentials are correct and are the same but it doesn't like it when I put the correct details in ?
Using IIS5.1, MySQL 4.0.18 and PHP 4.3.5
Everything else reports fine, phpinfo reports MySQL is enabled and it's all running fine in services etc and the file does work just not when I use my actual password
Sorry for the long post, TIA

This is actual file din't paste it all for some reason :)
<html>
<head>
<title>Test MySQL</title>
<body><table border="1">
<tr><td>Variable_name</td><td>Value</td></tr>
<?php
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo("<TR>");
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++) {
echo("<TD>" . $row_array[$j] . "</td>");
}
echo("</tr>");
}
?>
</table>
<?php } ?>
</body>
</html>

<html>
<head>
<title>Test MySQL</title>
<body><table border="1">
<tr><td>Variable_name</td><td>Value</td></tr>
<?php
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo("<TR>");
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++) {
echo("<TD>" . $row_array[$j] . "</td>");
}
echo("</tr>");
}
?>
</table>
<?php } ?>
</body>
</html>

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |