Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6323C476731 for ; Fri, 24 Jan 2003 02:59:32 -0500 (EST) Received: from rye.elite.net (rye.elite.net [67.118.192.8]) by postgresql.org (Postfix) with ESMTP id A5E9D4773E7 for ; Fri, 24 Jan 2003 02:26:21 -0500 (EST) Received: from webdev (customer125.static-ip.dsl.elite.net [67.118.198.125]) by rye.elite.net (8.9.3/8.9.3) with SMTP id XAA02659 for ; Thu, 23 Jan 2003 23:26:21 -0800 (PST) Message-ID: <01bc01c2c379$f6897d60$6e01a8c0@webdev> Reply-To: "Alan T. Miller" From: "Alan T. Miller" To: "POSTGRESLQ-PHP" References: <200301230150.h0N1ofh20670@smtp.wanadoo.es> <001b01c2c36e$9f8975c0$2100a8c0@mathewslaptop> Subject: Re: Date type: DATE Date: Thu, 23 Jan 2003 23:26:51 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/62 X-Sequence-Number: 1807 Please correct me if I am wrong but it looks like you are asking how to assemble the values in your PHP script into a string that you can insert into your database... if that is the case you need to use the concatenate operator in PHP. You can do this in a few ways... $date = $year . "-" . $month . "-" . $day; insert into s_objetivos_caso values ($dni,$date,$cod_s_objetivos,$conn); or right in the the query itself... insert into s_objetivos_caso values ($dni,$year . "-" . $month . "-" . $day,$cod_s_objetivos,$conn); you would need to check that second way to be sure, but the first one will work for sure. Alan ----- Original Message ----- From: "Mathew Dredge" To: "Jesus Rios" ; "POSTGRESLQ-PHP" Sent: Thursday, January 23, 2003 10:05 PM Subject: Re: [PHP] Date type: DATE > Try putting single quotes around the date, this works for me.. > > insert into s_objetivos_caso values ($dni,'$date',$cod_s_objetivos,$conn); > > > ----- Original Message ----- > From: "Jesus Rios" > To: "POSTGRESLQ-PHP" > Sent: Thursday, January 23, 2003 5:59 AM > Subject: [PHP] Date type: DATE > > > > > > Hi everybody. > > > > I've got a form where I ask for the date.I store the date in 3 variables: > for > > the day i have $day (dd), for the month i have $month (mm) and for the > year > > $year (yyyy). > > At the same time i have a table which is as it follows: > > Table "s_objetivos_caso" > > Column | Type | Modifiers > > -----------------+---------+----------- > > dni | integer | not null > > fecha | date | not null > > cod_s_objetivos | integer | not null > > > > How do i have to insert the column date?. > > > > $date="$year-$month-$day"; > > insert into s_objetivos_caso values ($dni,$date,$cod_s_objetivos,$conn); > > > > Can anyboy help me for how a i must format the date for introduce into > the > > table??? > > > > > > Thank you. And sorry with my English. > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 3: if posting/reading through Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that your > > message can get through to the mailing list cleanly > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html >