Re: Arrays

From: Date: Mon, 15 Apr 2002 20:17:58 +0000
Subject: Re: Arrays
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18519@lists.php.net to get a copy of this message
On Tuesday 16 April 2002 04:13, Alex Francis wrote: > I am trying to insert event dats into a database and to make sure the user > 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", > "eventday"); > > when I insert it into the database like: $query = "INSERT INTO $tablename4 > 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. You're trying to insert an array into something which is expecting a string. You should probably be concatenating your three fields into one string, something like: $eventdate = $eventyear . $eventmonth . $eventday; The exact format would depend on what field type your "eventdate" is. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I'm going to give my psychoanalyst one more year, then I'm going to Lourdes. -- Woody Allen */

« previous php.db (#18519) next »