I want to show data for logged in user, i am using sessions to login. This is the code i already have:
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
//this selects everything for the current user, ready to be used in the script below
$result = mysql_query("SELECT id, points, ingame_points, ingame_money, ingame_items FROM members;
WHERE username = $_SESSION['myusername']");
//this function will take the above query and create an array
while($row = mysql_fetch_array($result))
{
//with the array created above, I can create variables (left) with the outputted array (right)
$points = $row['points'];
$id = $row['id'];
$ingame_points = $row['ingame_points'];
$ingame_money = $row['ingame_money'];
$ingame_items = $row['ingame_items'];
}
Help :-\?