CHINA is the first country in the Headertbl table
Code: Select all
<?php
include_once("config.php");
include_once("functions.php");
// Check user logged in already:
// checkLoggedIn("yes");
doCSS(); ?>
<div id="header">
<p class="wrap">
<? print("\n <a href=\"post.php"."\">+ Add new header</a> ");?>
</p>
<h1 class="wrap">Avert Weekly Headers</h1>
</div>
<?
include_once("config.php");
$result = mysql_query("SELECT * FROM Headertbl ORDER BY HeaderDate DESC");
while($row = mysql_fetch_array($result))
{
echo '<div id="entry" class="wrap">';
$HeaderID = $row['HeaderID'];
$HeaderImage = $row['HeaderImage'];
$HeaderDate = $row['HeaderDate'];
$HeaderPhotoNo = $row['HeaderPhotoNo'];
$HeaderName = $row['HeaderName'];
$PhotoID = $row['PhotoID'];
$CountryID = $row['CountryID'];
$result1 = mysql_fetch_array(mysql_query("SELECT * FROM Headertbl LEFT JOIN country ON Headertbl.CountryID = country.CountryID "));
$Country = $result1['country'];
echo <<<EOF
<div class="entry_header">
<b>Header Name:</b> $HeaderName <a href="edit.php?HeaderID=$HeaderID">Edit Header</a> | <a href="delete.php?HeaderID=$HeaderID">Delete Header</a><br />
<a href="upload.php?HeaderID=$HeaderID">Change Header</a><br />
<a href="http://www.avert.org/photo_search.php?search_keyword_id=&search_country_id=country-$CountryID&page_type=thumbnails&search=search">Other pictures from $Country</a><br />
<b>PhotoID:</b> $PhotoID <br />
<b>Header Photo No:</b> $HeaderPhotoNo <br />
<b>Header Date:</b> $HeaderDate <br />
<img src="headers/$HeaderImage">
</div>
EOF;
echo '</div>';
}
mysql_close($link);
?>