Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6CCF44767BC for ; Fri, 24 Jan 2003 07:18:05 -0500 (EST) Received: from tomts17-srv.bellnexxia.net (tomts17.bellnexxia.net [209.226.175.71]) by postgresql.org (Postfix) with ESMTP id 934A747632B for ; Fri, 24 Jan 2003 07:17:52 -0500 (EST) Received: from acer.sympatico.ca ([65.93.66.175]) by tomts17-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20030124121754.RMZZ26205.tomts17-srv.bellnexxia.net@acer.sympatico.ca>; Fri, 24 Jan 2003 07:17:54 -0500 Message-Id: <5.1.1.6.0.20030124071129.009ff880@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Fri, 24 Jan 2003 07:15:33 -0500 To: Jesus Rios , "POSTGRESLQ-PHP" From: Frank Bax Subject: Re: Date type: DATE In-Reply-To: <200301230150.h0N1ofh20670@smtp.wanadoo.es> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/65 X-Sequence-Number: 1810 At 01:59 PM 1/22/03, Jesus Rios wrote: >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??? Perhaps you could tell us what goes wrong with the above coding. Others have mentioned issues with $date variable. Does the code look "exactly" as above? Surely you are coding the insert using pg functions? pg_exec ($conn, "insert into s_objetivos_caso values ($dni,'$date',$cod_s_objetivos)"; Frank