Jump to content

Can't store multiple values in a session variable


dejas

Recommended Posts

Hi there,

Can any one help? I am passing variable to store value in a session but can't store more than one value..

 

page1.php

session_start();

$Connection=@mysql_connect("localhost","root","")

or die("Database Connection Failed");

$db=mysql_select_db("abacorndb",$Connection) or die (mysql_error());

 

$sql="select f_id, f_name, f_description, f_price from tblfacilities";

$result=mysql_query($sql)

or die("reord doesn't exist");

if($result){

while ($row = mysql_fetch_array($result, MYSQL_ASSOC))

{

echo $row[f_name];

echo $row[f_description];

echo $row[f_price];

echo "<a href=test.php?f_id=".$row[f_id]."&price=".$row[f_price].">". Book. "</a>";

}

 

}

 

page2. php

 

session_start();

$_SESSION['id']=$_GET['f_id'];

echo $_SESSION['id'];

 

I would like to know how I can store all my f_id values from the clicked link in the session['id']. Now It only stores any one f_id value.

 

Any idea or suggestion. Please help needed urgently.

 

Thanks. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.