Hello, Im making a DB search tool...where you can choose which way to search with a dropdown,...e.g by keyword, by name etc. Im using this query code. if(isset($_GET['Town']) && !empty($_GET['Town']) && is_numeric($_GET['Town'])) $Town = trim($_GET['Town']); $query= "SELECT * FROM curiosities WHERE Town='".mysql_real_escape_string($Town)."'"; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); im also displaying that result with <?php echo $row1['FirstName']; ?>. inside a while loop <?php while($row1 = mysql_fetch_array($result)){ ?> my questions is this: Ok so this works for searching by Town,...but i want to be able to add another way to search, eg. by first name,..when i duplicate it and change the variables it no longer works..i need them to be able to choose what way they would like to search from. I also will need the new result to display in $row1 I appreciate anything. thank you, -Tim
This has been fixed, i place dit in an if else statement looking for a variable in my query string. Depending on the variable it chose the correct query. ROCK. ON.