Hi everyone,
Let me start off by saying that the db stores our vehicle plate numbers and more.
What I would like to do is run a query by the first 2-digits of the plate number. The first 2-digits represents the year of the vehicle. I would like to query by the year. If I chose 00 from the drop down it will show me all vehicles that were purchased in 00 (2000).
Here's my so called piece:
$querysearch = "select * from lsv where reg='$reg'";
$resultsearch = MYSQL_QUERY($querysearch);
$numbersearch = mysql_Numrows($resultsearch);
if ($numbersearch>0) {
$x=0;
?>
<table border=0 cellspacing=0 cellpadding=10>
<tr>
<td><b>REG</b></td>
<td><b>DECAL</b></td>
<td><b>SN</b></td>
<td><b>ORG</b></td>
<td><b>OFFSYM</b></td>
<td><b>STATUS</b></td>
</tr>
<?
while ($x<$numbersearch)
{
if (($x%2)==0) { $bgcolor="#FFFFFF"; } else { $bgcolor="#C0C0C0"; }
?>
<tr bgcolor="<? echo $bgcolor; ?>" height=30>
<? $reg=mysql_result($resultsearch,$x,"reg"); ?>
<td> <? echo $reg; ?> </td>
<? $decal=mysql_result($resultsearch,$x,"decal"); ?>
<td> <? echo $decal; ?> </td>
<? $sn=mysql_result($resultsearch,$x,"sn"); ?>
<td> <? echo $sn; ?> </td>
<? $org=mysql_result($resultsearch,$x,"org"); ?>
<td> <? echo $org; ?> </td>
<? $offsym=mysql_result($resultsearch,$x,"offsym"); ?>
<td> <? echo $offsym; ?> </td>
<? $status=mysql_result($resultsearch,$x,"status"); ?>
<td> <? echo $status; ?> </td>
</tr>
<?
$x++;
} // end while
} // end if
?>
</table>
Thanks