scottyrob
04-03-2006, 12:41 PM
Hi how would i go about doing this? I would like the data from my datbase being put into a table so that i have 2 rows of 5. The data that would be in each cell is just an Image and a name, underneath each other if possible... My current code is below, but that just outputs the data into a list...
<?
require 'db_connect.php';
echo "<link rel='stylesheet' type='text/css' href='css/main.css' />";
$start_year = $_GET["s"];
$end_year = $_GET["e"];
$query = "SELECT * FROM PLATE_BG_CHRISTMAS WHERE PROD_DATE >= '".$start_year."' and PROD_DATE <= '".$end_year."'";
$result = mysql_query($query) or die("Error: " . mysql_error() . " with query $query");
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
while ($row = mysql_fetch_array($result)) {
echo "<div class='position'>";
echo "<img src=\"IMAGES/PLATE_BG_CHRISTMAS/{$row['IMAGE']}\" / width='50' height='50' />"; echo "<br />";
echo $row['PROD_DATE'];
echo "</div>";
}
mysql_free_result($result);
?>
<?
require 'db_connect.php';
echo "<link rel='stylesheet' type='text/css' href='css/main.css' />";
$start_year = $_GET["s"];
$end_year = $_GET["e"];
$query = "SELECT * FROM PLATE_BG_CHRISTMAS WHERE PROD_DATE >= '".$start_year."' and PROD_DATE <= '".$end_year."'";
$result = mysql_query($query) or die("Error: " . mysql_error() . " with query $query");
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
while ($row = mysql_fetch_array($result)) {
echo "<div class='position'>";
echo "<img src=\"IMAGES/PLATE_BG_CHRISTMAS/{$row['IMAGE']}\" / width='50' height='50' />"; echo "<br />";
echo $row['PROD_DATE'];
echo "</div>";
}
mysql_free_result($result);
?>