I've been able to put together a basic search form that allows users to search my database by entering their last name. My question is how do I offer them an option, using a radio button, to allow them to search by, for example, a city or state or age, etc. Here is the code I have in place for a search of a user's last name:
<?php
$SQL_FROM = 'adr';
$SQL_WHERE = 'last';
?>
<?php
$searchq = strip_tags($_GET['q']);
$getRecord_sql = 'SELECT * FROM '.$SQL_FROM.' WHERE '.$SQL_WHERE.' LIKE "'.$searchq.'%"';
$getRecord = mysql_query($getRecord_sql);
if(strlen($searchq)>0){
echo '<ul>';
while ($list = mysql_fetch_array($getRecord)) {?>
<li><a href="runners2.php?name=<?php echo urlencode($list['first'].' '.$list['last']); ?>"><?php echo $list['last']; ?> <small><?php echo $list['first']; ?></small><small><?php echo $list['city']; ?></small><small><?php echo $list['age']; ?></small></a></li>
<?php }
echo '</ul>';
?>
<?php } ?>
If I used a radio button, this code would represent my "last name" search, but how would I also allow the user to search via other options? I'm assuming I would use IF...Else, but don't know how to construct the code around this search code.