X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 67048B439E4 for ; Thu, 3 Jul 2003 15:19:06 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 10850-06 for ; Thu, 3 Jul 2003 12:19:06 -0300 (ADT) Received: from tomts7-srv.bellnexxia.net (tomts7.bellnexxia.net [209.226.175.40]) by svr1.postgresql.org (Postfix) with ESMTP id 325CEB438DD for ; Thu, 3 Jul 2003 12:19:05 -0300 (ADT) Received: from hwcn.org ([65.92.41.144]) by tomts7-srv.bellnexxia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030703151903.SESX8834.tomts7-srv.bellnexxia.net@hwcn.org> for ; Thu, 3 Jul 2003 11:19:03 -0400 Date: Thu, 3 Jul 2003 11:19:14 -0400 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; delsp=yes; charset=US-ASCII; format=flowed Subject: query, display questions From: Michael Hanna To: pgsql-php@postgresql.org Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: Apple Mail (2.552) X-Archive-Number: 200307/11 X-Sequence-Number: 2123 I have a table: michael=# \d healthnotes Table "public.healthnotes" Column | Type | Modifiers --------+-------------------------- +------------------------------------------------------------- posted | timestamp with time zone | not null default ('now'::text)::timestamp(6) with time zone notes | text | Indexes: healthnotes_pkey primary key btree (posted) Often there are multiple entries per day. I want to display the day once, with all the entries on that day. So do I select * from notes and group by date, then write a nested for-loop in php that ignores the extra timestamp items? Seems a little inelegant. Or can I select distinct timestamps somehow after converting them to dates? Not sure how to go about this. Another question: I want to echo in an html page the timestamp and the note after it is entered. What php-pgsql commands do this? Michael