chuck1971 Posted November 19, 2007 Share Posted November 19, 2007 I have a drop down search form that I am populating with information from my database, and when I try to use it to search, I am returned with my page, but with no results. What am I doing wrong here? Thanks in advance for all te help!Here is the drop down code and the results page: <td> <select name="county" class="form" id="county" style="width: 165px"> <option value="">Any</option> <? include("includes/connect.php"); $county = mysql_query("SELECT * FROM locations ORDER BY county ASC"); while($result_county = mysql_fetch_array($county)) { ?> <option value="<? echo $result_county['county']; ?>" ><? echo $result_county['county']; ?></option> <? } ?> </select></td> <td align="right"><input name="Submit" type="submit" class="form" value="Submit" /> And here is the code for the results page: <? include("includes/connect.php"); $id = $_GET['id']; $query = mysql_query("SELECT * FROM locations WHERE id = $id"); $result = mysql_fetch_array($query); $numrows=@mysql_num_rows($query); if($numrows != 0) { while ($result = mysql_fetch_array($query)) { ?> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="justify" style="padding-top:1ex; padding-right:1.5ex; padding-bottom:1ex; padding-left:1.5ex"><strong><? echo $title; ?></strong><br /><? echo $address; ?><br /><? echo $city; ?>, <? echo $state; ?> <? echo $zipcode; ?><br />Phone: <? echo $phone; ?><br /><a href="location_details.php?id=<? echo id; ?>">Click Here for more information</a></div></td> </tr> </table></td> </tr> <? } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.