Posted by Jochem Maas on 12/08/05 12:00
Eternity Records Webmaster wrote:
> I have this code that doesnt print the db results like they should... it
'like it should' means what exactly?
> uses pear::db package for the database. Was wondering if anybody can figure
> out how come it doesnt work...
what does not work?
>
> <?php
> require_once 'DB.php';
> error_reporting('E_ALL');
>
> $db =& DB::connect('mysql://root:3987957@localhost/eternityrecords');
> if (PEAR::isError($db)) {
> die($db->getMessage()); }
> $results->query('select * from eternityrecords.journal');
> if (PEAR::isError($results)) {
> die($db->getMessage()); }
> //test the results out..
> ?>
> <table>
> <?php
> while($results->fetchInto($journal, DB_FETCHMODE_ASSOC)){
> ?>
> <tr>
> <td><?php echo $journal['ID']; ?></td>
> <td> <?php echo $journal['Date']; ?> </td>
> <td> <?php echo $journal['Subject']; ?> </td>
> <td> <?php echo $journal['Entry']; ?> </td>
> </tr>
> <?php }?>
> </table>
> <?php
> $db->disconnect();
> ?>
>
Navigation:
[Reply to this message]
|