I am trying to get sections of collage from a MySQL database using PHP and jQuery.
I am getting data normal, but I get an error when I use html() to add the result to a div
Here is my code:
$("#collage_id").on('change',function(e){
$("#sections").fadeOut(1200);
if(this.value==0){
$("#sections").fadeOut(1200);
}
else {
<?PHP
$collage_sections=new DataBase();
$sections=$collage_sections->get_sections();
$sections_checkbox="";
while($section=mysqli_fetch_array($sections)){
$sections_checkbox.="<label class='checkbox-inline'><input type='checkbox' value='$section[0]'>$section[1]</label>";
}
?>
$("#sections").html(<?PHP echo $sections_checkbox; ?>).fadeIn(1200);
}
});
Does anyone have any help or ideas?