<?php
$SearchNo = $_POST["SearchNo"];
$host= 'localhost';
$user= 'zutransportation';
$passwd= 'password';
$database= 'dbtransport';
$table= 'STUDENT';
$table2='BUS';
$connect= mysql_connect($host, $user, $passwd);
mysql_select_db($database);
$squery = "select * from $table where IDNo like '".$SearchNo."'";
$run= mysql_query($squery);
$num_results = mysql_num_rows($run);
if (!$SearchType )
{//1
echo "You have not selected search details. Please go back and try again. ";
}//1
else
{//2
if (!$connect)
{//3
echo"Error: Could not connect to database. Please try again later.";
}//3
else
{//4
echo "<div align=left>";
echo "";
echo "
<p>";
echo "<table border=1 width=97% >\n";
for ($i=0; $i<$num_results; $i++)
{//5
$row = mysql_fetch_array($run);
$SName = stripslashes($row["Name"]);
$IDNo = stripslashes($row["ID"]);
$email = stripslashes($row["Email"]);
$Phone = stripslashes($row["Phone"]);
$POBox = stripslashes($row["POBox"]);
$SDate = stripslashes($row["SDate"]);
$EDate = stripslashes($row["EDate"]);
$BusNo= stripslashes($row["busNum"]);
//$pquery= "select place from table2 where busNo='".$BusNo."'"; we'll added when everything is fine
}//5
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> nAME:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$SName."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> ID:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$IDNo."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> E-mail:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$email."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> Phone:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$Phone."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> P.O.Box:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$POBox."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> Starting Date:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$SDate."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> Ending Date:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$EDate."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> Bus Number:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$BusNo."</td>";
echo "</tr>";
/* This one when everything goes fine
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000> Place:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3> ".$pquery."</td>";
echo "</tr>";
*/
echo "</table>\n";
}//4
}//2
?>
Please help help :sad:
I don't know why I get this result always
"You have not selected search details. Please go back and try again. "
please help meeeeee