Hi,
From a form Iam recieving date info, in year, month, day, hour, minute, second variables. I want to convert these to a timestamp, and insert these into my mysql database, in a timestamp(14) field.
This is what I did:
After getting the variables from the post array, and checking that hey are correct:
$date = mktime($datehour, $dateminute, $datesecond, $datemonth, $dateday, $dateyear);
The insert:
$insertquery = "
insert into samples ( sa_plotnr, sa_name, sa_date, sa_crew, sa_inserted, sa_copyright)
values
( '$row[pl_id]', '$sample[$i]', '$date', '$crew[$i]','$_SESSION[userid]', '$copyright[$i]')";
Strangely enough, the data field is not filled. And IF I grab the timestamp from the echod query, and insert it maually, the date doesn't get close to what I filled out in the form..
I've been trying this for half an hour now, and I am pretty sick of it. What am I missing!??
Thanks
J.