Re: Re: Printing Fields in Database

From: Date: Mon, 06 Oct 2003 22:54:42 +0000
Subject: Re: Re: Printing Fields in Database
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22418@lists.php.net to get a copy of this message
On 6 Oct 2003 at 16:08, Tomas V.V.Cox wrote: > Roger Spears wrote: > > > Hello, > > > > I'm running Red Hat 9 and Apache. I have a script that stores > > information in a database. I need to "batch" print specific fields > > based on the dates they were created. I have recently learned that > > the printer functions in PHP are for windows machines. I was > > wondering if anyone out there would care to share how they achieve > > this? How do you print from a database? > > <?php > require 'DB.php'; > $fp = fopen('/dev/lp0', 'w'); > $db = DB::connect('mysql://...'); > $res = $db->getAll('SELECT * FROM mytable'); > foreach ($res as $row) { > fputs($fp, explode(', ', $row) . "\n"); > } > ?> > > If you need something more sophisticated I've hear that Agatha Report > is able to generate postcript reports from database queries, maybe > that helps. Which Agatha are you after? Where could information on this be found? There is one Agatha-project on sourceforge - but that's about an mp3- playlist-system :-) Stefan

« previous php.pear.dev (#22418) next »