I passed id from 1 page to another-
<?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-
<?php
$ide=$_GET['id'];
$result1 = mysql_query("SELECT * FROM page where name='ide'",$connection);
while($re1=mysql_fetch_array($result1))
{
echo $re1["name"];
}
it works sine on the sending side ..BUT the problem is it’s not displaying anything on the reciever side..i tested that it’s not even going inside the while loop.
please help?
This will go horribly wrong as soon as you start deleting records in the database as the
$idvariable in the first script is not related to a specific database entry at all.If the ID you are passing around is stored in the database field
name, it should be something like:Edit: changed
nametoidfor the ID:and: