0

我将如何在具有多项选择的查询中使用它,它必须类似于

SELECT * FROM venue_event where venue = $check or $check ??  

形式

 <form action="test.php" method="post">
 <input type="checkbox" name="check_list[]" value="value 1">
 <input type="submit" />
 </form>
 <?php
 if(!empty($_POST['check_list'])) {
 foreach($_POST['check_list'] as $check) {
        echo $check;
}
}
?>
4

1 回答 1

1

我不太了解 php,无法发布该部分,但您的 SQL 查询最终应该看起来像:

SELECT *
FROM venue_event
WHERE venue IN ('venue1','venue2');

或者您可以使用 OR:

SELECT *
FROM venue_event
WHERE venue = 'venue1' OR 
    venue = 'venue2';
于 2013-02-17T01:32:06.880 回答