Hi guys, could you please check this code for me. basically displaying data from two table.
i get error massage like...
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\dis_take.php on line 91
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("uni", $con);
$result = mysql_query("SELECT take.StudentID,student.StudentName,take.CourseID,course.CourseName FROM take,student,course WHERE take.StudentID = student.StudentID AND take.CourseID = course.CourseID AND StudentID LIKE '$_POST[sid]%' ORDER BY StudentID ASC");
echo"<br>";
echo "<center><table width=700 border=1>";
echo "<tr><th>StudentID</th><th>StudentName</th><th>CourseID</th><th>CourseName</th></tr>";
while($row = mysql_fetch_array ($result))
{
echo "<tr><td>";
echo $row['StudentID'];
echo "</td><td>";
echo $row['StudentName'];
echo "</td><td>";
echo $row['CourseID'];
echo "</td><td>";
echo $row['CourseName'];
echo "</td></tr>";
}
echo "</table>";
mysql_close($con);
?>