
Tabla json
Publicado por Leo (50 intervenciones) el 11/09/2014 14:29:40
Hola que tal? armo la siguiente tabla mediante json pero me larga un error y no se donde se encuentra. Queria saber si me pueden ayudar a identificarlo. Muchas gracias
.js
script .php
.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function inicioTablaInscripcionCursada(){
oTablaInscripcionCursada = $('#dtincripcionmateria').dataTable({
"iDisplayLength": 10,
"iDisplayStart": 0,
"bProcessing": false,
"bServerSide": false,
"bLengthChange": false,
"bAutoWidth": false,
"bPaginate": true,
"aaSorting":[[0, "desc"]],
"bDestroy":true,
"bSort":false,
"bJqueryUI":true,
"sAjaxSource" : "scripts/listar_inscripcion_cursada.php",
"aoColumns": [
{ "sTitle": "Nombre Alumno", "sWidth": "400px", "bSortable": true, "bVisible": true },
{ "sTitle": "Nombre Materia", "sWidth": "400px", "bSortable": true, "bVisible": true },
{ "sTitle": "Nombre Carrera", "sWidth": "400px", "bSortable": true, "bVisible": true },
],
"oLanguage": {
"sEmptyTable": "No hay datos",
"sInfo": "Mostrando desde _START_ hasta _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros",
"sInfoFiltered": "(filtrado de _MAX_ registros en total)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": "Mostrar _MENU_ registros",
"sLoadingRecords": "Cargando...",
"sProcessing": "Procesando...",
"sSearch": "Buscar:",
"sZeroRecords": "No se encontraron resultados",
"oPaginate": {
"sFirst": "Primero",
"sLast": "Ultimo",
"sNext": "Siguiente",
"sPrevious": "Anterior"
}
}
});
return oTablaInscripcionCursada;
}
script .php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
include('conexion.php');
$sql = "SELECT numlegajo, idcarrera, idmateria FROM cursada";
$rs = mysql_query($sql,$coneccion);
$cantidad = mysql_num_rows($rs);
$i=0;
$arr = '';
while($row=mysql_fetch_array($rs)){
$i = $i + 1;
$arr .= '["'.$row[0].'","'.$row[1].'","'.$row[2].'",]';
}
$arr = '{"aaData":['.$arr.']}';
echo $arr;
?>
Valora esta pregunta


0