开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜