如果我选择一个学期,它将填充部分,我有 3 个下拉列表(学期、部分和主题)。现在,如果我选择一个部分,它将填充主题,但它不会读取学期。它只显示所选部分的所有可用科目,而不考虑它是哪个学期。
function showSEMESTER(semester)
{
var item = semester;
var dataString = 'semester='+ semester;
$.ajax
({
type: "POST",
url: "class-select.php",
data: dataString,
cache: false,
success: function(html)
{
$("#class_id").html(html);
}
});
}
function showSubject(section)
{
var item = section;
var dataString = 'code='+ item;
$.ajax
({
type: "POST",
url: "subject-select.php",
data: dataString,
cache: false,
success: function(html)
{
$("#subject_id").html(html);
}
});
}
这是主题选择的sql
$query = "select * from subject where class_id = '$_POST[code]' and semester_id='$_POST[semester]' ";
这不会返回任何 $_post[semester]