i am trying to run this code but i am not getting anything from the mysql_fetch_assoc($result)
it is just blank can anyone help me
thanks in advance
<html>
<body>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="hayden"; // Mysql password
$db_name="ecng3020"; // Database name
$tbl_name="students"; // Table name
$tbl_name_1="staff"; // Table name
$sql="SELECT * FROM $tbl_name WHERE id_no='$username' and password='$password='";
if (mysql_connect("$host","$username","$password"))
echo "<p>connected to mysql</p>";
else
echo "<p>could not connect</p>";
if (mysql_select_db("$db_name"))
echo "<p>selected db</p>";
else
echo "<p>could not select db</p>";
if ($result = mysql_query($sql))
echo "<p>success</p>";
else
echo "<p>fail</p>";
while ($row = mysql_fetch_assoc($result))
{
echo "<p>$row[0] $row[1] $row[2] $row[3] $row[4] $row[5]";
}
?>
</body>
</html>