Hi all,
I have numerous links, each with unique values. For simplicity purposes I'll use two links...(each taken from separate queries.)
<a href="view_files.php?ida='.$array['id'].'">'.$array['name'].'</a>
<a href="view_files.php?idb='.$array['id'].'">'.$array['name'].'</a>
When a certain link is selected the relevant code from the switch statement should be used.
However, the first one is always used. Why is this?
if(!empty($_GET))
{
// Connect to database
include('../../../db_connect.php');
// declare variables
$ida = $_GET['ida'];
$idb = $_GET['idb'];
// check which file selected
switch(TRUE)
{
case ('$ida'):
$query = "SELECT name, type, size, content ".
"FROM mergers ".
"WHERE id = '$ida'";
echo $query;
break;
case ('$idb'):
$query = "SELECT name, type, size, content ".
"FROM centralised_archive.mergers ".
"WHERE id = '$idb'";
echo $query;
break;
}
$result = mysql_query($query) or die(mysql_error());