User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,997 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,192 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 668 | Replies: 1
Reply
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  
Join Date: May 2006
Posts: 13
Reputation: maiahost is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
maiahost maiahost is offline Offline
Newbie Poster

Re: You have not selected search details.

  #2  
Jun 11th, 2006
[php]if (!$SearchType )
{//1
echo "You have not selected search details. Please go back and try again. ";
}//1
[/php]
Replace $SearchType with $SearchNo - should work fine
Reply With Quote  
Reply

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)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 10:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC