I am trying to do an image gallery for a movie database. I did the following code, however movies found in the database are being listed one under each other. I would like that the movies be displayed 5 movies in a row under each other.
Any help please?
Code: Select all
<?php
//this is used to connect with the database
require('dbconnect.php');
include('securitycheck.php');
session_start();
?>
<!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>Online Movie Database - Coming Soon</title>
<link rel="stylesheet" href="CSSWebStyles/style.css" />
<link rel="shortcut icon" href="Images/filmicon.ico"/>
</head>
<body>
<div id="website">
<?php
//will include the code from banner.php file (banner & navigation)
include('banner.php');
?>
<?php
//checking if the user is an administrator
if (isset($_SESSION['superadmin'])) {
if ($_SESSION['superadmin'])
include('adminmenu.php');
}
?>
<div id="content">
<div id="contentgeneral">
<br />
<center>
<h2>Coming Soon Movies</h2><p />
</center>
<br />
<?php
$select = "SELECT * FROM movies WHERE MovieReleaseDate >= '" . date("Y-m-d") . "' ORDER BY MovieReleaseDate ASC";
$result = mysql_query($select);
if (mysql_num_rows($result) > 0) {
while ($movie = mysql_fetch_array($result)) {
echo "<div style=\"overflow: auto;\">";
echo "<hr style=\"border: 1px solid #06C\" />";
echo "<table><tr>";
echo "<td>";
echo '<center><img src="images/movies/' . $movie['Filename'] . '" width="125" height="185" /></center>';
echo "</td>";
echo "</tr><tr>";
echo "<td>";
echo "<center><a href=\"moviedetails.php?id=" . $movie['MovieID'] . "\">" . $movie['Title'] . "</a></center>";
echo "</td>";
echo "</tr><tr>";
echo "<td>";
echo "<center>will be released on " . date("d/m/Y", strtotime($movie['MovieReleaseDate'])) . " </center>";
echo "</td>";
echo "</tr></table>";
echo "<hr style=\"border: 1px solid #06C\" />";
echo "</div>";
}
} else {
echo "<center><b>No Coming Soon Movies found</b></center>";
}
?>
</div>
</div>
<?php
//will include the code from footer.php file
include('footer.php');
?>
</div>
</body>
</html>