query($sql_insert)) { $json = new stdClass(); $json->user = $user_id; $json->tipo = "$stamp_type"; $json->data = "$stamp_date"; $json->ora = "$stamp_time"; $json_stamp = json_encode($json); echo nl2br("Timbratura imprtata: ".$json_stamp." - "); $id = mysqli_insert_id($con); $stamp_datetime = $stamp_date . " " . $stamp_time; $sql_insert_event = "INSERT INTO tbl_events VALUES (NULL,'$stamp_type','$stamp_datetime','$stamp_datetime',$user_id,0,'#2196f3','Timbratura',$id)"; if ($con->query($sql_insert_event) === true) { echo nl2br("Evento creato\n"); } else { echo nl2br("Evento non creato\n"); } } } else { echo nl2br("Badge ".$array[$x][0]." non trovato\n"); } } echo "Fine importazione"; $con->close();