In your example $id only is a counter. As I think in your page's table must has filed id and your must send it to another page . Like this.
<?php
$sql = "SELECT * FROM page";
$result = mysql_query("SELECT * FROM page",$connection);
while($re=mysql_fetch_array($result))
{
echo"<a href=\"test.php?id={$re['id']}\">{$re["name"]}'</a>'";
}?>
In page :
$ide=$_GET['id'];
$result1 = mysql_query("SELECT * FROM page where id='$ide'",$connection);
while($re1=mysql_fetch_array($result1))
{
echo $re1["name"];
}
If I miss and in your pages' table id field is absent then you must recent name to url not id .. Like this
<?php
$sql = "SELECT * FROM page";
$result = mysql_query("SELECT * FROM page",$connection);
while($re=mysql_fetch_array($result))
{
echo"<a href=\"test.php?id={$re['name']}\">{$re["name"]}'</a>'";
}?>
// In page :
$ide=$_GET['id'];
$result1 = mysql_query("SELECT * FROM page where name='$ide'",$connection);
while($re1=mysql_fetch_array($result1))
{
echo $re1["name"];
}
But if you want to use counter (I can understand for why). You must do this in limit statement. Like this :
<?php
$sql = "SELECT * FROM page";
$result = mysql_query("SELECT * FROM page",$connection);
$id=0;
while($re=mysql_fetch_array($result))
{ $id++;
echo"<a href=\"test.php?id={$id}\">{$re["name"]}'</a>'";
}?>
// and used this on the reciever page-
$ide=$_GET['id'];
$result1 = mysql_query("SELECT * FROM page LIMIT '$ide',1",$connection);
while($re1=mysql_fetch_array($result1))
{
echo $re1["name"];
}
{$var}syntax it will make your code easier to read:echo"<a href=\"test.php?id={$id}\">{$re["name"]}'</a>'";should beecho "<a href=\"test.php?id=$id\">{$re['name']}</a>";