I am creating an address book using php and mysql in which i need to create mailing labels from the list of address in my database.i need to group the addresses in a such a way that only 5 addresses should come in the first row and proceed to the next consecutive rows with the increase in number of data..since i do not know the number of data i could not limit the number of addresses to 5 in each row and i am getting all the addresses in a single line...can anyone help me????
The code is as follows:
[HTML]
<?php
include "connection.php";
$label=mysql_query("select * from address_book") or die("Query failed ".mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table cellpadding="25" cellspacing="25">
<tr>
<?
while($resultset=mysql_fetch_array($label)) {
?>
<td>
<? echo $resultset['Name']; ?><br />
<? echo $resultset['Company']; ?><br />
<? echo $resultset['off_Street']; ?><br />
<? echo $resultset['off_Location']; ?><br />
<? echo $resultset['off_City']; ?><br />
<? echo $resultset['off_State']; ?><br />
<br />
</td>
<?
}
?>
</tr>
</table>
</body>
</html>[/HTML]