here is the problem. I have this page: www.prebowl.com/members/koth/index.php
its a very basic script, search and print the data.
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="590" id="AutoNumber1">
<tr>
<td width="431">
<form method="POST" action="index.php">
<table border="1" bordercolor="#000080" width="400" id="AutoNumber2">
<tr>
<td width="200">Insert your search criteria</td>
<td width="200">Search by</td>
</tr>
<tr>
<td width="200"><input type="text" name="searchstring" size="27"></td>
<td width="200"><select size="1" name="searchtype">
<option value="last_name" selected>Last Name</option>
<option value="date">Date</option>
</select></td>
</tr>
<tr>
<td width="200"> </td>
<td width="200"> </td>
</tr>
</table>
<p><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="B2"></p>
</form>
</td>
<td width="157"> </td>
</tr>
<tr>
<td width="431">
</td>
<td width="157">
</td>
</tr>
<tr>
<td width="588" colspan="2">
<!---------------------->
<!-- RESULTS -->
<?
if ($submit)
{
if ($searchtype == "last_name")
{
$sql="SELECT * FROM tournament_koth WHERE $searchtype LIKE '$searchstring' ORDER BY first_name ASC";
$db = mysql_connect("space.powweb.com", "tokyocory", "z9m15g");
mysql_select_db("bowling",$db);
$result = mysql_query($sql,$db);
echo "<table width=590>";
echo "<TR>";
$myrow = mysql_fetch_array($result);
echo "<TD colspan=9 height=20 align=center>Search results for ".$searchstring."</TD>";
echo "</TR>";
echo "<TR>";
echo "<td height=9 width=590 colspan=9>";
echo "<p align=center>";
echo "<img border=0 src=../../images/graphics/thinblue.jpg width=90% height=1>";
echo "</td>";
echo "</TR>";
while ($myrow = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td width=203 colspan=3><b>".$myrow["last_name"].", ".$myrow["first_name"]."</b></td>";
echo "<td width=96 colspan=2>".$myrow["date"]."</td>";
echo "<td width=48><font size=2>HDCP</font></td>";
echo "<td width=49><font size=2>".$myrow["hdcp"]."</font></td>";
echo "<td width=100><font size=2>HDCP Total:</font></td>";
echo "<td width=94><font size=2>".$myrow["hdcp_total"]."</font></td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor=#99CCFF width=107>";
echo "<font size=2 color=#000080>Qualifying</font></td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual1"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual2"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual3"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual4"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual5"]."</font>";
echo "</td>";
echo "<td width=49 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual6"]."</font>";
echo "</td>";
echo "<td width=100 bgcolor=#99CCFF><font color=#000080>";
echo "SCR Total:</font>";
echo "</td>";
echo "<td width=94 bgcolor=#99CCFF><font color=#000080>";
echo $myrow["scr_total"]."</font></td>";
echo "</tr>";
}
echo "</table>";
}
else if ($searchtype == "date")
{
$sql_date="SELECT * FROM tournament_koth WHERE $searchtype LIKE '%$searchstring%' ORDER BY hdcp_total DESC";
$db = mysql_connect("space.powweb.com", "tokyocory", "z9m15g");
mysql_select_db("bowling",$db);
$result = mysql_query($sql_date,$db);
echo "<table width=590>";
echo "<TR>";
$myrow = mysql_fetch_array($result);
echo "<TD colspan=9 height=20 align=center>Search results for ".$searchstring."</TD>";
echo "</TR>";
echo "<TR>";
echo "<td height=9 width=590 colspan=9>";
echo "<p align=center>";
echo "<img border=0 src=../../images/graphics/thinblue.jpg width=90% height=1>";
echo "</td>";
echo "</TR>";
while ($myrow = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td width=203 colspan=3><b>".$myrow["last_name"].", ".$myrow["first_name"]."</b></td>";
echo "<td width=96 colspan=2>".$myrow["date"]."</td>";
echo "<td width=48><font size=2>HDCP</font></td>";
echo "<td width=49><font size=2>".$myrow["hdcp"]."</font></td>";
echo "<td width=100><font size=2>HDCP Total:</font></td>";
echo "<td width=94><font size=2>".$myrow["hdcp_total"]."</font></td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor=#99CCFF width=107>";
echo "<font size=2 color=#000080>Qualifying</font></td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual1"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual2"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual3"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual4"]."</font>";
echo "</td>";
echo "<td width=48 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual5"]."</font>";
echo "</td>";
echo "<td width=49 bgcolor=#99CCFF><font size=2 color=#000080>";
echo $myrow["qual6"]."</font>";
echo "</td>";
echo "<td width=100 bgcolor=#99CCFF><font color=#000080>";
echo "SCR Total:</font>";
echo "</td>";
echo "<td width=94 bgcolor=#99CCFF><font color=#000080>";
echo $myrow["scr_total"]."</font></td>";
echo "</tr>";
}
echo "</table>";
}
}
?>
when i search by names i dont get all the results that are in search by date and vice-versa. Its strange because its the same table and search string except that it searchs a different column. Any ideas???
Cory