I need to generate a schedule of a certain period, but it is giving this error.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE [42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; ('19: 00: 00 ',' 31 ',' 12 '), and you can use the following syntax: '2016') 'at line 1
$dataInicio = '2016-01-01';
$intervalo = 60;
do {
list( $ano, $mes, $dia ) = explode('-', $dataInicio);
$inicio = '07:00:00';
$final = '19:00:00';
do {
list($hora, $minuto, $segundo ) = explode(':', $inicio);
$sql = "INSERT INTO agenda (hora_agenda,data_agenda(day),data_agenda(month),data_agenda(year)) VALUES('$inicio','$dia','$mes','$ano')";
$inicio = date("H:i:s", mktime($hora, $minuto + $intervalo, $segundo, $mes, $dia, $ano));
} while ($inicio <= $final);
$dataInicio = date('Y-m-d', mktime(0, 0, 0, $mes, $dia + 1, $ano));
} while (date('Y') == date('Y', strtotime($dataInicio)));
$dados = connection::exec($sql);