pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedNo output while using PEAR DB & formatted time-string
2+ messages / 1 participants
[nested] [flat]
* No output while using PEAR DB & formatted time-string
@ 2003-11-01 11:00 Marcus Krause <marcus.k79@expires-2003-11-30.arcornews.de>
0 siblings, 1 reply; 2+ messages in thread
From: Marcus Krause @ 2003-11-01 11:00 UTC (permalink / raw)
To: pgsql-sql
I have a problem in using the to_char function in a SQL-Statement
and addressing it with DB_FETCHMODE_OBJECT under PEAR DB.
The follwing code is working fine unless I'm adding the to_char function:
--------------------------------------------------------------
require_once 'DB.php';
$dsn = $$$;
$db = DB::connect($dsn);
$db->setFetchMode(DB_FETCHMODE_OBJECT);
$query .= "SELECT news_id,to_char(news_time,'DD.MM.YYYY HH24:MI'), ";
$query .= "FROM News ";
$query .= "WHERE news_id=$var";
$sth = $db->query($query);
while($newsid_row=$sth->fetchRow()) {
print <<<HTML
$newsid_row->news_id<br> <!-- there's an output -->
$newsid_row->news_time<br> <!-- there's no output -->
blabla
HTML;
}
$db->disconnect();
--------------------------------------------------------------
Has anybody an idea to get this working or similar experiences?
Thanks for your patience; could be the wrong newsgroup!?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: No output while using PEAR DB & formatted time-string
@ 2003-11-01 12:05 Marcus Krause <marcus.k79@expires-2003-11-30.arcornews.de>
parent: Marcus Krause <marcus.k79@expires-2003-11-30.arcornews.de>
0 siblings, 0 replies; 2+ messages in thread
From: Marcus Krause @ 2003-11-01 12:05 UTC (permalink / raw)
To: pgsql-sql
Am 01.11.2003 12:00 meinte Marcus Krause:
> $query .= "SELECT news_id,to_char(news_time,'DD.MM.YYYY HH24:MI'), ";
The real code is without the comma at the end of the line above, so
it's not a simple SQL-Statement problem!
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-11-01 12:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-01 11:00 No output while using PEAR DB & formatted time-string Marcus Krause <marcus.k79@expires-2003-11-30.arcornews.de>
2003-11-01 12:05 ` Marcus Krause <marcus.k79@expires-2003-11-30.arcornews.de>
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