How are you guys
I'm importing some data from diferents tables in csv files but I have problems to import date values
here is the code i'm using
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$fname="xlsdate.csv"; //reading csv file
$fp=fopen($fname,"r") or die("csv Error");
$line = fgets( $fp, 2024 );
$c=mysql_connect("localhost","root","");//conecting with db
if(!$c)
{
die("Not Conected");
}
if(!mysql_select_db("date"))
{
die("Table Error");
}
while(!feof($fp))
{
list($date) =split( ",", $line);
$line = fgets( $fp, 2024 );
$ctd=$ctd+1;
if($ctd > 1)
{
if($date!="")
{
if(!($inserc=mysql_query("INSERT INTO update (date_update)
VALUES('$date')")))
{
echo'<center>';
echo'<br>';
echo mysql_error();
echo'<br>';
echo"User Insert Error";
echo'</center>';
}
}
}
}
fclose($fp);
?>
</body>
</html>
It works perfect to import any kind of data but I don't know what should I do to import also date.