pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keary Suska <hierophant@pcisys.net>
To: Postgres-PHP <pgsql-php@postgresql.org>
Subject: Re: Date type: DATE
Date: Fri, 24 Jan 2003 10:03:24 -0700
Message-ID: <BA56BFEC.17907%hierophant@pcisys.net> (raw)
In-Reply-To: <01bc01c2c379$f6897d60$6e01a8c0@webdev>

on 1/24/03 12:26 AM, amiller@hollywood101.com purportedly said:

> $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.

Neither of these will work, nor any previous suggestion, as date formats are
ambiguous and *must* be quoted:

 $date = $year . "-" . $month . "-" . $day;
 insert into s_objetivos_caso values ($dni,"'$date'", $cod_s_objetivos,$conn
);

This *will* work, at least as far as the date is concerned.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"




view thread (6+ messages)

Message-ID: <BA56BFEC.17907%hierophant@pcisys.net>
Permalink:  ../BA56BFEC.17907%25hierophant@pcisys.net/
Also on:    postgresql.org/message-id/BA56BFEC.17907%hierophant@pcisys.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: hierophant@pcisys.net
  Subject: Re: Date type: DATE
  In-Reply-To: <BA56BFEC.17907%hierophant@pcisys.net>
  References: <01bc01c2c379$f6897d60$6e01a8c0@webdev> <BA56BFEC.17907%hierophant@pcisys.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox