the really content of getTable.php is this
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> //this is in my twig file
<script>
$('btn').click(function(){
$('#test').load("{{asset('getTable.php #list')}}");
});
</script>
//in the getTable.php file
<table>
<thead>
<tr>
<th>Type</th>
<th>Nombre de Place Libre</th>
<th>Nombre de Place Exigé</th>
</tr>
</thead>
<tbody>
<?php
$bdd=new PDO('mysql:host=localhost;dbname=gestion_ressources_humaines', 'root','');
$reponse=$bdd->query('SELECT id, type, nbPlaceLibre, nbPlaceExige FROM fonction');
while ($donnees = $reponse->fetch())
{
?>
<tr>
<td style="display:none;"><?php echo $donnees['id']; ?></td>
<td><?php echo $donnees['type']; ?></td>
<td><?php echo $donnees['nbPlaceLibre']; ?></td>
<td><?php echo $donnees['nbPlaceExige']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
$reponse->closeCursor(); // Termine le traitement de la requête
?>
<script>
$(function(){
$("tr").click(function(){
$('tr').removeClass('selected');
if($(this).hasClass('selected'))
$(this).removeClass('selected');
else
$(this).addClass('selected');
});
});
</script>
<p id="hello">Hello world!!!</p>