Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D8B69475F85 for ; Tue, 28 Jan 2003 07:02:32 -0500 (EST) Received: from smtp.wanadoo.es (unknown [62.37.236.135]) by postgresql.org (Postfix) with ESMTP id C2F94475CEE for ; Tue, 28 Jan 2003 07:02:31 -0500 (EST) Received: from there (62-36-72-74.dialup.uni2.es [62.36.72.74]) by smtp.wanadoo.es (8.11.3/8.10.2) with SMTP id h0SC2VJ08035 for ; Tue, 28 Jan 2003 13:02:32 +0100 (MET) Message-Id: <200301281202.h0SC2VJ08035@smtp.wanadoo.es> Content-Type: text/plain; charset="iso-8859-1" From: Jesus Rios To: "POSTGRESLQ-PHP" Subject: PROBLEMA CON EL TIPO DATE DE UNA COLUMNA DE UNA TABLA Date: Tue, 28 Jan 2003 13:04:10 +0100 X-Mailer: KMail [version 1.3.2] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/79 X-Sequence-Number: 1824 Hi. I have written onces for the same question, with no sucess for me. I have a table so: Table "s_objetivos_caso" Column | Type | Modifiers - ----------------+---------+----------- dni | integer | not null fecha | date | not null cod_s_objetivos | integer | not null I have 3 variables in my form where i get the date: $fecha_anho,$fecha_mes,$fecha_dia. when i want to insert into the table io do so: HERE IS THE PROBLEM $tabla="s_objetivos_caso"; $dni=232; $cod_s_objetivos=1; $aux_s_obj=inserta_tabla_generica_caso($dni,$tdate,$cod_s_objetivos,$conn,$ta bla); if(!$aux_s_obj) { echo ("Error al rellenar la tabla=s_objetivos_caso"); } ?> The function is : function inserta_tabla_generica_caso($denei,$data,$cod,$cone,$table) { $insert="INSERT INTO $table VALUES('$denei','$data','$cod')"; ******** $result=pg_exec($cone,$insert); if ($result) { return true; } else { return false; } } The error which throw me the navigator is: Warning: PostgreSQL query failed: ERROR: Bad date external representation '--' in /var/www/jesus/foniatra/globals.php on line 55 Error al rellenar la tabla=s_objetivos_caso line 55 is which who has ********** In which format i must put the date for insert it into the table? If it is a help , when i do: foniatra=# SELECT now()::date; ------> ------------ 2003-01-28 (1 row) In my form i have this: FECHA DE LA CONSULTA (yyyy) Thank you. -------------------------------------------------------