Estoy creando un modal que al cambiar el option del select me cambie los valores de la consulta, pero me sale el siguiente error. Alguien me puede explicar que estoy haciendo mal por favor.
Ajax
$("#puestoHorario").change(function(){
var puestoHorario = $(this).val();
var turnoHorario = $("#turnoHorario").val();
$.ajax({
url: 'modal/modalHorarios.php',
data: {puestoHorario: puestoHorario, turnoHorario: turnoHorario},
method: 'post',
success: function(response) {
$("#tablaHorariosPuesto").html(response);
}
})
})
PHP
<table id="tablaHorariosPuesto" class="table table-hover table-bordered">
<thead>
<tr>
<th scope="row">Nombre</th>
<th>Lunes</th>
<th>Martes</th>
<th>Miercoles</th>
<th>Jueves</th>
<th>Viernes</th>
<th>Sabado</th>
<th>Domingo</th>
</tr>
</thead>
<tbody>
<?php
if(isset($_POST['turnoHorario']) || isset($_POST['puestoHorario'])){
$turnoHor = $_POST['turnoHorario'];
$puesHora = $_POST['puestoHorario'];
$sqlHorTur = "SELECT * FROM personal WHERE puesto='$puesHora' AND turno='$turnoHor'";
$queryTurHor = mysqli_query($mysqli, $sqlHorTur);
while($turHor = mysqli_fetch_array($queryTurHor)){
$datosTurHor .= '<tr>
<td>'.$turHor[1].'</td>
</tr>';
}
echo $datosTurHor;
}
?>
</tbody>
</table>
Y este es el error *** Warning: mysqli_query() expects parameter 1 to be mysqli, null given in