和$country
值$job_type
来自下拉列表
if ($country == 'All' && $job_type == 'All') {
$data = mysql_query("SELECT * FROM cv ")
}else {
$data = mysql_query("SELECT * FROM cv WHERE country='$country' AND job='$job_type'")
}
和$country
值$job_type
来自下拉列表
if ($country == 'All' && $job_type == 'All') {
$data = mysql_query("SELECT * FROM cv ")
}else {
$data = mysql_query("SELECT * FROM cv WHERE country='$country' AND job='$job_type'")
}
你似乎错过了一些;
,试试这个:
if ($country == 'All' && $job_type == 'All')
{
$data = mysql_query("SELECT * FROM cv WHERE country='$country' AND job='$job_type'");
} else {
$data = mysql_query("SELECT * FROM cv");
}
本杰明有一点,你的 IF 逻辑似乎不正确。也许你想要这个?
if ($country == 'All' && $job_type == 'All')
{
$data = mysql_query("SELECT * FROM cv");
} else {
$data = mysql_query("SELECT * FROM cv WHERE country='$country' AND job='$job_type'");
}