How to search between 2 listboxes in PHP?
I want to search between 2 listboxes like "from"
and "to"
.开发者_如何学C
Do you mean get values from a database depending on the values of list boxes? Then it would look like
mysql_query(
'SELECT *
FROM mytable
WHERE from_field = "'. mysql_real_escape_string($_POST['from_field']) .'"
AND to_field = "'. mysql_real_escape_string($_POST['to_field']) .'"',
$conn);
Providing the to and from select boxes are called to_field
and from_field
respectively, and you called your mysql connection $conn.
精彩评论