•
•
•
•
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
![]() |
•
•
Join Date: May 2006
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
[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> 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
?>
[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
[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> 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
?>
[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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
adsense adult advertising blog blogging bomb book business coding competition copyright daniweb development earth engine environment failure forum gentoo google internet legal linux malware marketing mcafee microsoft monetization msn news operating pagerank phishing php privacy publishing revenue search security silverlight software spam spyware support system technical web webmaster wiki yahoo
- Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in (PHP)
- hi-Business.com is for sale! (Domain Names for Sale)
- Selecting options (C++)
- search and results problem (PHP)
- searching multiple fields (PHP)
- updating 2 HTML tables on one PHP page (PHP)
- Duplication (C++)
Other Threads in the PHP Forum
- Previous Thread: need help using links like test.php3?id=2
- Next Thread: Parse error: parse error, unexpected T_STRING


Linear Mode