Reply to Re: Table duplication

Your name:

Reply:


Posted by Jules Winnfield on 03/12/05 14:24

Marquez Design wrote:
> I am trying to display information in an html table from a MySQL data base.
> I can do this rather easily, however, I am trying to multiply that table
> with as many entries there are in the database.
>
> Can someone point me in the right direction or give me an example of how I
> can accomplish this?
>
> I can multiply rows and columns from the db, but can not multiply the table.
>
> example:
>
> <table>
> <tr>
> <td> $entry </td>
> </tr>
> <tr>
> <td> $entry2 </td>
> </tr>
> </table>
>
> I would like to multiply this as many times as there is entries in the
> database for entry and entry2.
>
> Thank you,
>
> Steve Marqurez
> smarquez@marquez-design.com

Maybe you can do something with this.

while($row = mysql_fetch_array($rs, MYSQL_NUM))
{
if ($i % 2 == 0) $bg="#d2e1ff";
if ($i % 2 == 1) $bg="#F7F7F7";

$datum = $row[1];
echo "<tr bgcolor=$bg>";
echo "<td>&nbsp;$row[0]&nbsp;</td>";
echo "<td><b>$row[3]</b>&nbsp;&nbsp;&nbsp;&nbsp;$datum</td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor=$bg>&nbsp;</td>";
$text = str_replace("###","<br>",$row[2]);
$text = str_replace("<br>\n<br>\n<br>\n<br>","<br>\n<br>",$text);
$text = str_replace("<br>\n<br>\n<br>","<br>\n<br>",$text);
echo "<td bgcolor=$bg>" . $text . "</td>";
echo "</td>";
echo "</tr>";
$i+=1;
}

--




E-mail: luc@websitemeester.nl
Internet: http://www.websitemeester.nl

[Back to original 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

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