<select name="filtering">
<option value="a">a</option>
<option value="b">b</option>
,爲什麼不正確運行?
if (isset($_POST['filtering']) == "a") {
$stmt = prepare("SELECT * FROM user_posts ORDER BY post_time DESC LIMIT :limit OFFSET :offset");
}
if (isset($_POST['filtering']) == "b") {
$stmt = prepare("SELECT * FROM user_posts ORDER BY post_time ASC LIMIT :limit OFFSET :offset");
}
Isset返回真/假 – 2016-08-21 07:41:00