Why am I getting an error
Uncaught TypeError: Unable to read property 'mData' from undefined
I respect the requirements of DataTables (and also read another topic about my mistake, and I respect every answer and solution). Please help me.
Here is my PHP code:
<table class="table table-striped table-bordered table-hover" id="sample_1"> <thead> <tr> <th class="table-checkbox"> <input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/> </th> <th> Utilizator </th> <th> Nume complet </th> <th> Clasa </th> <th> Functia </th> <th> E-Mail </th> <th> Ultima logare </th> </tr> </thead> <tbody> <? foreach($data["users"] as $student) { ?> <tr class="odd gradeX"> <td> <input type="checkbox" class="checkboxes" value="1"/> </td> <td> <? echo $student["username"]; ?> </td> <td> <? echo " ".$student["last_name"]." ".$student["first_name"].""; ?> </td> <td> <? echo getclass($student["class"]); ?> </td> <td> <? $functie = 0; if($student["role"] == 1) { $functie = 1; echo "Administrator site"; } if($student["fctsc"]) { $functie = 1; echo "Director"; } if($student["diriginte"]) { $functie = 1; echo "Diriginte"; } if($student["profesor"]) { $functie = 1; echo "Profesor"; } if($functie == 0) echo "Elev"; ?> </td> <td> <a href="mailto:<? echo $student["email"]; ?>"> <? echo $student["email"]; ?> </a> </td> <td class="center"> <? echo $student["lastlogin"]; ?> </td> </tr> <? } ?> </tbody> </table>
source share