The code is all on one php page(index.php).
In the first part of the code the link is created, which passes $row['id'] to index.php
foreach($tables as $value)
{
$query = "SELECT id, name FROM ". $value;
$result = mysql_query($query) or die(mysql_error());
echo '<b>' . $value . '</b><br />';
while ($row = mysql_fetch_assoc($result))
{
echo '<a href="index.php?id='.$row['id'].'">'.$row['name'].'</a><br />';
}
In the second part of the code(as above, which is at the top of the php page) the $row['id'] is retrieved by $GET['id'] and set to variable $id.
$id= $_GET['id'];
$query = "SELECT name, type, size, content FROM ".$value." WHERE id = '$id'";
So basically how do I do this with the tablename?
I want to set a value for $value.
As you can see it has a value in the foreach loop but isn't sent as variable in the link...
oreach($tables as $value)
{
$query = "SELECT id, name FROM ". $value;
$result = mysql_query($query) or die(mysql_error());
echo '<b>' . $value . '</b><br />';
while ($row = mysql_fetch_assoc($result))
{
echo '<a href="index.php?id='.$row['id'].'">'.$row['name'].'</a><br />';
}
echo '<br />';
}
And $row['id'] is sent as variable via the link so can I send $value like this?
Hope this makes sense. I understand my own code and apoligies if I haven't been explaining very clearly.
thanks.