You are here: RE: [PHP] broken code.... « PHP « IT news, forums, messages
RE: [PHP] broken code....

Posted by "Mark Steudel" on 12/08/05 20:10

What happens when you print out journal?:

print_r( $journal );

Are your keys the exact case as your table fields?

ID vs id or Date vs date




-----Original Message-----
From: Eternity Records Webmaster [mailto:webmaster@eternityrecords.org]
Sent: Wednesday, December 07, 2005 11:31 PM
To: php-general@lists.php.net
Subject: [PHP] broken code....

I have this code that doesnt print the db results like they should... it
uses pear::db package for the database. Was wondering if anybody can figure
out how come it doesnt 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(); ?>

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация