this is my full query for searching data from multiple table. still i could not get any result. could anyone check please where am i made mistake?
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("uni", $con);
$sql = "
SELECT take.StudentID
,student.StudentName
,take.CourseID
,course.CourseName
FROM take
,student
,course
WHERE take.StudentID = student.StudentID
AND take.CourseID = course.CourseID
AND take.StudentID LIKE '$_POST[sid]%'
ORDER BY take.StudentID ASC
";
$result = mysql_query($sql) or trigger_error('MySQL Error: ' . mysql_error(), E_USER_ERROR);
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 mysql_error();
{
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);
?>