PHP GET Help
where when I select on a page, it gets the information from my db and prints the required info....
script
............
Connect to db info here....
<a href="index.php?Link1">Link 1</a>
<a href="index.php?Link2">Link 2</a>
<a href="index.php?Link3">Link 4</a>
<a href="index.php?Link4">Link 4</a>
<?php
if ($_GET['Link1'] !=NULL) {
$liststring = "SELECT * FROM buysell WHERE subcategoryid='1'";
}
else if ($_GET['Link2'] !=NULL) {
$liststring = "SELECT * FROM buysell WHERE subcategoryid='2'";
}
else if ($_GET['Link3'] !=NULL) {
$liststring = "SELECT * FROM buysell WHERE subcategoryid='3'";
}
else {
$liststring = "SELECT * FROM buysell'";
$listInfo = mysql_query($liststring);
}
?>
<?php
while($row = mysql_fetch_array($listInfo)) {
print "<li>".$row['name']." ".$row['description']."</li>";
}
?>
....
Above is the script and it prints out all of the information, however when it comes to the if statement when wanting the content to change when I select on a link (Link1 , Link2) the information does not appear and i am left with an error.
Any help appreciated...
Stuart
yes, I am....