Hi,
I have the following prob: I have code that generates HTML tables from a MySQL query. It works fine, the only thing is that the first row only has 3 columns, where the other rows have 4. How can I make all rows have 4 columns?
Here's the code that I use now:
==========================================
<tr>
<?php
dbuser();
$query="SELECT * FROM user WHERE confirmed = 'YES' and picture = 'YES' and weight='1' order by created desc limit 0, 39";
$res=mysql_query($query);
$rowcount=0;
while($row=mysql_fetch_array($res)) {
$profile=$row[0];
$picture=$row[6];
$country=$row[9];
$state=$row[10];
$region=$row[12];
$figura="a" . $profile . ".jpg";
if(++$rowcount%4==0)
{
?>
</tr>
<tr>
<?php
}
?>
<td> <table>
<tr>
<td width="146" height="105" align="center"><a href="../profiles/profile.php?id=<? printf("$profile") ?>"><img src="../profiles/pictures/a/<? printf("$figura") ?>" border="0"></a></td>
</tr>
<tr>
<td class="textProfileHeader" align="center"><a href="../profiles/profile.php?id=<? printf("$profile") ?>" class="textProfileHeader"><? printf("$profile") ?></a></td>
</tr>
<tr>
<td class="textWhiteS" align="center"><a href="../profiles/search.php?s=3&id=<?=$row['region']?>">
<?=$row['region']?>
</a></td>
</tr>
<tr>
<td class="textWhiteS" align="center"><a href="../profiles/search.php?s=<? printf("$search") ?>&id=<? printf("$paese") ?>"><? printf("$paese") ?></a></td>
</tr>
<tr>
<td height="10"> </td>
</tr>
</table></td>
<?php
}
for($rowcount;$rowcount%4!=0;$rowcount++) {
?>
<td></td>
<?php
}
?>
==========================================
THX for helping me out : )
Mike