had a little typo...
"what this code is an attempt at is after every 4 records, it prints "</tr><tr>" in order to print the next 4 results from the database on the next row."
Residue wrote:
Hello, im fairly new to php, as well as mysql, but here goes.
I have created a database which contains information on various models. im attempting to make a page which displays 4 headshots per row, with the model's name below it in a table and my code is as follows:
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="124"><tr>
<?PHP
$link = mysql_connect("localhost", "user", "pass");
mysql_select_db("dbMain") or die("Could Not Connect");
$result = mysql_query("select * from ModelStats ORDER BY id DESC");
while($line = mysql_fetch_array($result))
{
echo "<td width='25%' align='center' height='1'>";
echo "<a href='", $line["Nick"],"/main.htm'>";
echo "<img border='0' src='", $line["Nick"],"/headshot.jpg' width='113' height='150'></a>";
echo "<a href='", $line["Nick"],"/main.htm'>", $line["FName"],"</a></td>";
For($line // 4) { echo "</tr><tr>"; }
}
?>
</table>
what this code is an attempt at is after every 4 records, it prints "</tr>....