Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/03/2012, 07:17
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
problemas con php,postgresql en centos

Hola amigos del foro espero me puedan ayudar

implemente fullcalendar que php,postgresql y en windows funciona perfectamente pero me ha tocado migrarlo para un centos y no me funciona.

he insertado por base de datos para visualizar los eventos y la aplicacion no los lista.
tampoco los inserta.

tengo que habilitar algo en el php.ini ?

con esta funcion inserto en la base de datos los alert los muestra bien

Código Javascript:
Ver original
  1. select: function(start, end, allDay) {
  2.  
  3.                 var title = prompt('Evento:');
  4.  
  5.                 if (title) {
  6.  
  7.                     $.ajax({
  8.  
  9.                          url:'archivo.php',
  10.  
  11.                          type:'post',
  12.  
  13.                          data:{
  14.  
  15.                             title: title,
  16.  
  17.                             start: start.toUTCString(),
  18.  
  19.                             end: end.toUTCString(),
  20.  
  21.                             allDay: allDay,
  22.  
  23.                             }
  24.  
  25.                        
  26.  
  27.                     }).done(function(data) {
  28.  
  29.                         alert("Evento Guardado");
  30.  
  31.                          //alert("Datos guardados, respuesta: " + start);
  32.  
  33.                     });

en el archivo.php tengo lo siguiente
Código PHP:
Ver original
  1. $title = $_POST['title'];
  2.  
  3. $allDay = urldecode($_POST['allDay']);
  4.  
  5. $start = urldecode($_POST['start']);
  6.  
  7. $fin = $_POST['end'];
  8.  
  9.  
  10.  
  11. $fecha_ini=urldecode($_POST['start']);
  12.  
  13. $fecha = date_create($fecha_ini);
  14.  
  15. $fechaFormateada=date_format($fecha, 'Y-m-d H:i:s');
  16.  
  17. $fechaRestada = date('Y-m-d H:i:s',  strtotime($fechaFormateada.' -5 hour'));
  18.  
  19.  
  20.  
  21. $fecha_fin=urldecode($_POST['end']);
  22.  
  23. $fechaf = date_create($fecha_fin);
  24.  
  25. $fechaFormateadaf=date_format($fechaf, 'Y-m-d H:i:s');
  26.  
  27. $fechaRestadaf = date('Y-m-d H:i:s',  strtotime($fechaFormateadaf.' -5 hour'));
  28.  
  29.  
  30.  
  31. $servidor = 'localhost';
  32.  
  33. $bd = 'calendario';
  34.  
  35. $usuario = 'postgres';
  36.  
  37. $contrasenia = 'hoe798cs';
  38.  
  39.    
  40.  
  41. global $servidor, $bd, $usuario, $contrasenia;
  42.  
  43. $db = new PDO('pgsql:host=' . $servidor . ';dbname=' . $bd, $usuario, $contrasenia);
  44.  
  45.  
  46.  
  47.  
  48.  
  49. $consulta = $db->prepare("INSERT INTO eventos (id_evento,titulo,prueba,inicio,fin)
  50.  
  51.                                  VALUES (nextval('eventos_id_evento_seq'),'".$title."','$allDay','$fechaRestada','$fechaRestadaf')");
  52.  
  53. $consulta->execute();


no entiendo porque no funciona
ayudenme por favor