<?php
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("project") or die("Can't Connect to Database...");
$qqqe="SELECT * FROM groupp";
$queryRessource10 = mysql_query($qqqe,$link) or die(mysql_error());
$numrows=mysql_num_rows($queryRessource10);
if($numrows > 0)
{
while($row10 = mysql_fetch_array($queryRessource10 )) {
$group_id=$row10['group_id'];
$_SESSION['G_ID']=$group_id;
echo "<a href=group.php?group_id=".$group_id." title='".$row10['group_name']."'>".$row10['group_name']."</a><br />";
}}}?>
my problem is not with generate the id i got it perfect group.php?id=(the id of group from database ) my problem when i go to the page the session keep taking the last group_id in while loop ( number 2 ) so how i can get the session to be send correctly for id=1 i send session 1 when i open the group page