开发者

How to search between 2 listboxes in PHP?

开发者 https://www.devze.com 2023-01-06 09:13 出处:网络
I want to search between 2 listboxes like \"from\" and \"to\".开发者_如何学CDo you mean get values from a database depending on the values of list boxes?Then it would look like

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

精彩评论

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