Okay, I have a website for my machinima series, Summerbreeze.
I have a page for the cast, and I have the entire cast stored in a MYSQL database, with four columns:
ID
Name
Picture
Bio
I figured out how to get them added, but I need some help getting them to be displayed. You see, I have it so that all of the pictures show, and then I'm going to link them to their individual page each. That's fine. But how can I insert a break into the code after a certain number of pictures without having to manually put in images and everything?
Here's the page I'm working on:
http://mscreashuns.savefile.com/summerbreeze/cast.php
You can see they go
Picture
Picture
Picture
...
I want them to go
Picture Picture Picture
Picture Picture Picture
...
Here's the code I am using now for the above page:
<? include("header.inc");
// Make a MySQL Connection
mysql_connect("HOST", "USERNAME", "PASSWORD") or die(mysql_error());
mysql_select_db("DATABASE_NAME") or die(mysql_error());
// Get all the data from the "cast" table
$result = mysql_query("SELECT * FROM cast")
or die(mysql_error());
echo "<table align=center cellspacing=7 cellpadding=0 border='0'>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td><img src='";
echo $row['picture'];
echo "' width=111 height=300 ALT='";
echo $row['name'];
echo"'></td></tr>";
}
echo "</table>";
include("footer.inc"); ?>
The headers and footers aren't an issue, just the stuff in between. If you can tell me how I can make it break after three pictures. Right now I have it breaking after each picture. Thanks!