Re: Table duplication

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

 



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@xxxxxxxxxxxxxxxxxx

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@xxxxxxxxxxxxxxxxx Internet: http://www.websitemeester.nl

--
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