Jump to content

searching data column wise!


mtvaran

Recommended Posts

could anyone please check this code for me. i get the error msg like...

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\dis_study.php on line

 

 

<?php 

$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }


mysql_select_db("uni", $con);

$result = mysql_query("SELECT study.StudentID,student.StudentName,study.ProgrammeName FROM study,student WHERE study.StudentID = student.StudentID 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>ProgrammeName</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['ProgrammeName'];
echo "</td></tr>";

}

echo "</table>";
mysql_close($con);

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.