i wanted to store username of current logged in user
mysql_query(" UPDATE member SET url = 'ques2.php'
WHERE username = '$username' ") or die('Unable to update members URL: ' . mysql_error());
//in this i wanted to update my column url which is the last visited url of the logged in user
i had used this to retireve my username
while($info = mysql_fetch_array( $data ))
{
//Print $info['username'] ;
if($info['username']==($fgmembersite->UserName('username')))
{
$username=$info['username'];
break;
}
}
but it is not retrieving the username of the logged in user AND I WANT TO STORE IT IN VARIBLE SO THAT I CAN RUN MY UPDATE QUERY….what is the problem in my code….please help.
Store it in session:
Then on other pages, you can get it from that:
Make sure to put
session_start()on top of every page where you use it.