Hi,
Just learning PHP & MySQL, I am testing mysql right now, I have a code from book to test, the code is;
<html>
<head>
<title>Test MySQL</title>
<body>
<!-- mysql_up.php -->
<?php
$host="localhost";
$user="root";
$password="";
mysql_connect($host,$user,$password);
$sql="show status";
$result = mysql_query($sql);
if ($result == 0)
echo("<b>Error " . mysql_errno() . ": " . mysql_error() . "</b>");
elseif (mysql_num_rows($result) == 0)
echo("<b>Query executed successfully!</b>");
else
{
?>
<!-- Table that displays the results -->
<table border="1">
<tr><td><b>Variable_name</b></td><td><b>Value</b></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>
the book says that it should work and display some tables but I got this error message
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up1.php on line 11
Warning: mysql_query(): Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up1.php on line 13
Warning: mysql_query(): A link to the server could not be established in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up1.php on line 13
Error 1045: Access denied for user 'ODBC'@'localhost' (using password: NO)
few things noticed there, i keyed in password but it say's passworrd says No.
can anyone please help me on this . . .red red