I have Excel sheet which has different column,but i need to add some specific column in the data base(email,date and time).The date start from 9/7/14 and every things work well until 9/12/14 ,but when the day become 13 up to end of the month ,I'm getting 1970-01-01 01:00:00 into the data base,again when the month change to 10 ,everything is fine until 10/12/14 and again form 13 I'm getting 1970-01-01 01:00:00 into the data base.
this is my insert.php code
session_start();
$target_dir = $_SESSION["targetDir"];
$file_name = $_SESSION["fileName"];
ini_set('memory_limit', '512M');
require_once 'excel_reader2.php';
require_once 'dbConn.php';
$data = new Spreadsheet_Excel_Reader($target_dir);
for($i=0;$i<count($data->sheets);$i++) // Loop to get all sheets in a file.
{
switch ($i) {
case 1:
echo "<p class='font_p'>Rows in Sheet $i : " . count($data->sheets[$i]['cells'])."    " ;
$countWithHeader = count($data->sheets[$i]['cells']);
$finalCount = $countWithHeader - 1;
for ($j = 1; $j <= count($data->sheets[$i]['cells']); $j++) // loop used to get each row of the sheet
{
$data->sheets[$i]['cells'][$j][1];
$email = mysqli_real_escape_string($connection, $data->sheets[$i]['cells'][$j][1]);
$first_name = mysqli_real_escape_string($connection, $data->sheets[$i]['cells'][$j][2]);
$last_name = mysqli_real_escape_string($connection, $data->sheets[$i]['cells'][$j][3]);
$in_time = mysqli_real_escape_string($connection, $data->sheets[$i]['cells'][$j][5]);
$out_time = mysqli_real_escape_string($connection, $data->sheets[$i]['cells'][$j][6]);
$timestampIn = date('Y-m-d H:i:s',strtotime($in_time));
$timestampOut = date('Y-m-d H:i:s',strtotime($out_time));
$query = "INSERT INTO study_table (email,last_name,first_name,in_time,out_time)
VALUES ('".$email."','".$first_name."','".$last_name."','".$timestampIn."','".$timestampOut."')";
mysqli_query($connection, $query);
}
break;
case 2: