tengo inconveniente para crear array json
el primer dato no me llega id_evento
Código PHP:
}Ver original
<? $servidor = 'localhost'; $bd = 'calendario'; $usuario = 'postgres'; $contrasenia = 'hoe798cs'; global $servidor, $bd, $usuario, $contrasenia; $db = new PDO('pgsql:host=' . $servidor . ';dbname=' . $bd, $usuario, $contrasenia); $consulta = $db->prepare("SELECT * FROM eventos"); $consulta->execute(); // Initializes a container array for all of the calendar events while($fila = $consulta->fetch(PDO::FETCH_ASSOC)) { $id =$fila['id_evento']; $title =$fila['titulo']; $start =$fila['inicio']; $end =$fila['fin']; $allDay=$fila['prueba']; // Stores each database record to an array $buildjson = array('id' =>'$id_evento','title' => "$title", 'start' => "$start", 'end' => "$end", 'allDay' => "$allDay"); // Adds each array into the container array } // Output the json formatted data so that the jQuery call can read it ?>
Código SQL:
Ver original
CREATE TABLE eventos ( id_evento serial NOT NULL, titulo CHARACTER VARYING(64), prueba BOOLEAN, inicio TIMESTAMP WITH TIME zone, fin TIMESTAMP WITH TIME zone, CONSTRAINT pk_eventos PRIMARY KEY (id_evento) )