Re: Little Problem with my Guestbook

From: Date: Wed, 14 Sep 2005 07:26:07 +0000
Subject: Re: Little Problem with my Guestbook
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-222361@lists.php.net to get a copy of this message
<?php include("sql.inc.php"); include("config.inc.php"); $connection = mysql_connect($sql['host'],$sql['uid'],$sql['pwd']); $select_db = mysql_select_db($sql['db']); $select = mysql_query('SELECT * FROM comments'); $data = mysql_fetch_array($select); $result = mysql_query('SELECT * FROM comments'); $rows = mysql_num_rows($result); ?> <?php echo " G&auml;stebucheintr&auml;ge gesamt: $rows"; ?> <table border="1" width="95%"> <tr> <td> ID: </td> <td> <?php echo $data["id"]; ?> </td> </tr> <tr> <td> Name: </td> <td> <?php echo $data["autor"]; ?> </td> </tr> <tr> <td> Titel: </td> <td> <?php echo $data["titel"]; ?> </td> </tr> <tr> <td> Kommentar: </td> <td> <pre><?php echo $data["comment"]; ?></pre> </td> </tr> </table> Thats the code i have written. And I would like to post the <table>........</table> how often I have SQL-entries in my database. I hope you understand what I would like to say. And in each cycle it ought to put out the next entry of the database. Florian P. "Jasper Bryant-Greene" <jasper@bryant-greene.name> schrieb im Newsbeitrag news:4327C604.5070607@bryant-greene.name... > Florian Paucke wrote: > > I need some help from you, because, I'm creating a > > guestbook. But I have a little problem. > > > > I have a table, where the different My-SQL-Entries > > are read out. > > But now I get only one Entry, but not more. > > > > How can do it, that the table read out 4 times, when > > 4 entries are in the database? > > > > And the cursor from the database are jumping to > > the next entry. > > > > Sorry for my bad english. :) > > Please provide the code that is causing problems so that we can > understand your problem and help you fix it. > > -- > Jasper Bryant-Greene > Freelance web developer > http://jasper.bryant-greene.name/

« previous php.general (#222361) next »