Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\FYP\assign_module_CA.php on line 20
Access denied for user 'ODBC'@'localhost' (using password: NO)
can someone pls help???
this is the code i type for my webpage.Thks alot
<?php
session_start();
include 'ui.control.php';
head('Assign Course To Course Administrator');
box();
nav();
//connect to database
$HOST = 'localhost';
$USERNAME = 'root';
$PASSWORD = '';
$DB = 'sjas';
$link = mysqli_connect($HOST,$USERNAME,$PASSWORD,$DB);
$query = "SELECT idmember,name,role FROM member";
$result = mysql_query($query) or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Age</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array($result))
{
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['name'];
echo "</td></tr>";
echo $row['role'];
echo "</td></tr>";
}
echo "</table>";
?>
footer();
?>