Thanks for your inputs, MotDog.
I rewrote my script with regards to the date and time, and now at least I get the right values:
$time_array = getdate();
foreach($time_array as $item => $val ) {
$item = $val;
}
$thisYear = $time_array[year];
$thisMonth = $time_array[mon];
$thisDay = $time_array[mday];
$thisHour = $time_array[hours];
$thisMin = $time_array[minutes];
if($thisMonth < 10) $thisMonth = "0".$thisMonth;
if($thisDay < 10) $thisDay = "0".$thisDay;
if($thisHour < 10) $thisHour = "0".$thisHour;
if($thisMin < 10) $thisMin = "0".$thisMin;
$subscr_date = (int)$thisYear.$thisMonth.$thisDay;
$subscr_time = (int)$thisHour.$thisMin;
However, I still get a MySQL error:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key, name, gender, dob, area) VALUES (20091107, 1239, '123.123.123.123', 'aa', 'i' at line 1
My SQL query again:
$create = "INSERT INTO users (subscr_date, subscr_time, subscr_ip, signature, password, email, key, name, gender, dob, area) VALUES ($subscr_date, $subscr_time, '$subscr_ip', '$signature', '$password', '$email', '$key','$name', '$gender', $dob, '$area')";
I store the md5'ed password as VARCHAR (32) is that correct?
Anything else that could generate the error?
I hoped I had found the problem, but appearantly it was not enough...