Hi All
Having some major problems getting mysql to play nice
I need to insert dates into a table. i have set the field to date format, not dame time
But when I try to insert a date into the table with the sql below I get an error
I get this error
Incorrect date value: '' for column 'date' at row 1
Now I can go into php admin and insert exactly the same thing and it works, ie the date as a date and not a string.
Does anyone have any ideas, its driving me mental
Aaron
Having some major problems getting mysql to play nice
I need to insert dates into a table. i have set the field to date format, not dame time
But when I try to insert a date into the table with the sql below I get an error
Code:
<?php require_once('../Connections/essential.php'); ?>
<?php
//Get the date variables from the form on the previous page //
$picdate = $_POST['date']
?>
<?php
//Insert the new date value into the gallery_dates table //
mysql_query("INSERT INTO `gallery_dates` ( `id` , `date` )
VALUES (
NULL , '$picdate'
); ")
or die(mysql_error());
I get this error
Incorrect date value: '' for column 'date' at row 1
Now I can go into php admin and insert exactly the same thing and it works, ie the date as a date and not a string.
Does anyone have any ideas, its driving me mental
Aaron