datatable can't working with me !!

datatable can't working with me !!

bechirmradbechirmrad Posts: 20Questions: 6Answers: 0

i have this code please tell me what is my problem for the datatable doesn't work !
<?php include 'conn.php'; $Chaines = array(); $rs = odbc_exec($conn,$sqlAllChaines); while (odbc_fetch_row($rs)) { $IdChaine=odbc_result($rs,1); $Chaines[$IdChaine] = odbc_result($rs,2); } global $IdChaine, $NomChaine,$Chaines; ?>
<html>
<head>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready( function () {
$('#tab').DataTable();
} );
</script>
</head>
<body>
<table class="display" id="tab" border="1" >
<th>Id Chaine</th>
<th>Nom Chaine</th>
<?php
foreach ($Chaines as $IdChaine => $NomChaine){ ?>
<tr>
<td align="center">
<?php print_r($IdChaine)?> </td>
<td align="center">
<?php print_r($NomChaine)?> </td>
<?php } ?>
</tr>
<th>Id Chaine</th>
<th>Nom Chaine</th>
</table>
</body>
</html>

AND THANKS :smile:

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.