Re: Little Problem with my Guestbook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?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@xxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:4327C604.5070607@xxxxxxxxxxxxxxxxxxxxx
> 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/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux