Your $eventdate variable is an array, not a string so you can't just
drop it into an sql query string like that.
If you have separate fields in the db for year, month and day then you
probably want something like:
$query = "insert into ... values ( ... , '$eventdate',
'$eventdate', '$eventdate', ...)";
Otherwise, if they're all supposed to go into the same field then do
$eventdatestring = join("-", $eventdate);
$query = "insert into ... values ( ..., '$eventdatestring', ...)";
This should insert the date in the form "eventyear-eventmonth-eventday";
On Monday, April 15, 2002, at 03:13 PM, Alex Francis wrote:
> I am trying to insert event dats into a database and to make sure the
> puts the date in the correct format. I am now trying to collect the
> information from the three fields and insert it into one field.
> code as follows: $eventdate = array ("eventyear", "eventmonth",
> when I insert it into the database like: $query = "INSERT INTO
> VALUES ('0', '$entername', '$date', '$eventdate', '$eventheading',
> '$eventbody' )";
> for the $eventdate variable the word "array" is inserted.
> Could someone please tell me where I am going wrong.
> Alex Francis
> Cameron Design
> 35, Drumillan Hill
> Greenock PA16 0XD
> Tel 01475 798106
> [EMAIL PROTECTED]
> This message is sent in confidence for the addressee only. It may
> legally privileged information.
> Unauthorised recipients are requested to preserve this confidentiality
> to advise the sender
> immediately of any error in transmission.
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php