Estimad@s
Alguien me puede ayudar a descubrir la causa de que no se realicen los registros en la base de datos??
<?php
$NombreBD = "registros";
$Servidor = "localhost";
$Usuario = "root";
$Password ="123123";
$IdConexion = mysql_connect($Servidor, $Usuario, $Password);
mysql_select_db($NombreBD, $IdConexion);
// sample data from user input:
$f_inicio = ('2014-01-31');
$f_termino = ('2014-02-16');
$hora_1 = ('08:00:00');
$hora_2 = ('08:17:00');
$hora_3 = ('08:32:00');
$origen = ('ESTERILIZACION');
$destino = ('UCI');
$funcionario = ('JPEREZ');
$startTime = strtotime($f_inicio);
$endTime = strtotime($f_termino);
$values = array();
for($time = $startTime; $time <= $endTime; $time = strtotime('+1 day', $time))
{
$thisDate = date('Y-m-d', $time);
$values[] = "($destino, $funcionario, $origen, '$thisDate' , $hora_1, $hora_2, $hora_3)";
}
//
$query = sprintf(
"INSERT INTO reg (date, origen, destino, funcionario, hora_1, hora_2, hora_3 ) VALUES\n%s",
implode(",\n", $values)
);
// Imprime
echo "<pre>$query</pre>";
?>