Code: Select all
<?php
include ('mysql_connect.php');
if (isset($_GET['id'])) {
$id = $_GET['newstype'];
} else {
echo 'Please select a news type.';
exit();
}
$query = "SELECT * FROM news_posts WHERE newstype=$id";
$result = @mysql_query($query);
if ($result) {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td>$row[title]</td>
</tr>
</table>"; }
}
?>Code: Select all
<a href=posts.php?id=$row[newstype]><img src=images/$row[newstype].gif border=0 /></a>Cheers,
Xager