I have a table with the following columns:
countryID countryname countrycode
I want to create a table of X rows with 7 columns containing each countryname seperated by ~ until the end of the table.
EX.
united states ~ canada ~ china ~ ....... ~ chile
cuba ~ .... etc.
The problem I am having, how do I set the number of entries PER ROW before going to the next one (i.e. insert seven countrynames then <TR> then seven more).
SAMPLE CODE:
This obviously doesn't work but suggestions are appreciated.
<?php
print "<TABLE width=\"660\" ALIGN=\"CENTER\">";
$query = mysql_query("SELECT * FROM country WHERE countrycode != 'US' AND countrycode != 'CA'",$db);
$i = 0;
while($i < 7,$result[$i] = mysql_fetch_array($query),$i++) {
print "<TR><TD>$result[$i]</TD></TR>";
$i++;
}
print "</TABLE>";
?>
TIA,
/frank