Hi All, I wish to query a database depending on the user selection from a drop down and input form field. I have all my database queries but need the user to be able to search say - all people from country x (Country x being selected from a drop down) If I have say:
<select name="Country" id="Country">
<option value="Country1">Country1</option>
<option value="Country2">Country2</option>
<option value="Country3">Country3</option>
</select>
and that have a name beginning with say "Peter" - again selected from the input field e.g.
<input type="text" name="first_name"/>
I alread know how to do the database queries but not sure how I pass the select or first name to the query string. When I grab $first_name = "fisrt_name"; from the post, how do I put it in the query string?
can I say - $result = mysql_query("SELECT $first_name FROM $country");
I would love some advice on this please if anyone can help me