Hi I'm trying to update my HTML reservation sheet based on a MySQL query. I tried to use a PHP while
loop in my JavaScript but I can't do it.
Here's my code
<script type="text/javascript">
<?php
$date = $_GET['JOUR'];
$login = $_GET['NAME'];
require('bdd.php');
//here my query
$req = "SELECT * FROM RESERVATION WHERE resa_jour = '$date'";
//here I exec the query
$reponse = $bdd->query($req);
while ($data = $reponse->fetch())
{
?>
jQuery(function ($) {
if (<?php echo $data['id'] ?>) {
$('.<?php echo $data['resa_salle'] . $data['resa_periode'] ?>').addClass('disable');
}
});
<?php } ?>
</script>