RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 727 | Replies: 1
Join Date: May 2006
Posts: 3
Reputation: Zayed is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Zayed Zayed is offline Offline
Newbie Poster

You have not selected search details.

  #1  
Jun 3rd, 2006
[php]
[code]
<?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>&nbsp;nAME:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$SName."</td>";
echo "</tr>";

echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;ID:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$IDNo."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;E-mail:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$email."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;Phone:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$Phone."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;P.O.Box:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$POBox."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;Starting Date:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$SDate."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;Ending Date:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$EDate."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;Bus Number:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$BusNo."</td>";
echo "</tr>";
/* This one when everything goes fine
echo "<tr>";
echo "<td width=21% height=2 valign=top><font color=#800000>&nbsp;Place:</font></td>";
echo "<td width=64% height=2 valign=top colspan=3>&nbsp;".$pquery."</td>";
echo "</tr>";
*/
echo "</table>\n";

}//4
}//2



?>

[inlinecode]
[/php]

Please help help

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
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:10 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC