Hi,
I have this page where i am getting a url variable to select all records from the database that have a certain catagory assigned to them.
The code that i am using is below but when i view the page it is only showing me the first row in the database with that particular catagory. Any ideas on why this is doing this or any other ways i could go about this task...
<html>
<head>
<title> The Kidlington Directory & Village Life - Online Directory </title>
<script language="javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
</script>
</head>
<?php include ("config.php") ?>
<?
$catagory = $_GET['catagory'];
$query = "SELECT * FROM `directory` WHERE `catagory`='$catagory'";
$result = mysql_query( $query );
if( $result && $details = mysql_fetch_object( $result ) )
{
$business = $details -> business;
$id = $details -> id; ?>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<body bgcolor="#000099" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="200" border="0" cellspacing="0" cellpadding="0" class="sitestyle" height="21">
<tr>
<td height="25">
<li> <a href="details.php?id=<? echo "$id";?>" onclick="NewWindow(this.href,'name','400','400','yes');return false"><? echo "$business";?></a> </li>
</td><? }?>
</tr>
</table>
</body>
</html>