Breana
08-20-2007, 11:36 AM
Ok, i have a table called users and inside it is a table called points.
I want to show the users current points after they login.
I use $uid, as a global val so if it aint there it will show the else var...
I cam up with this php but it wont pull the number out?
1-through-5000 so it'll look like this.
If logged in, You Have 0 Points!
Not logged in, Please login to view points!
Now it works in part, i logout it will say please login and if i login it switches back over all ok but it just wont show the actual number they have...
<?
if (logincheck($uid, $upwd)) {
$sql = "SELECT points FROM users WHERE userid = $uid";
$result = mysql_query($sql ,$db);
echo ("You Have $points Points");
} else {
echo ("Error");
}
?>
And in my Whos Online:
<?
$sql = "SELECT userid FROM users";
$result = mysql_query($sql ,$db);
echo ("Total Members $userid");
}
?>
<?
$sql = "SELECT status FROM users_online_table";
$result = mysql_query($sql ,$db);
echo ("Whos Online $userid");
}
?>
What did i do wrong?
I want to show the users current points after they login.
I use $uid, as a global val so if it aint there it will show the else var...
I cam up with this php but it wont pull the number out?
1-through-5000 so it'll look like this.
If logged in, You Have 0 Points!
Not logged in, Please login to view points!
Now it works in part, i logout it will say please login and if i login it switches back over all ok but it just wont show the actual number they have...
<?
if (logincheck($uid, $upwd)) {
$sql = "SELECT points FROM users WHERE userid = $uid";
$result = mysql_query($sql ,$db);
echo ("You Have $points Points");
} else {
echo ("Error");
}
?>
And in my Whos Online:
<?
$sql = "SELECT userid FROM users";
$result = mysql_query($sql ,$db);
echo ("Total Members $userid");
}
?>
<?
$sql = "SELECT status FROM users_online_table";
$result = mysql_query($sql ,$db);
echo ("Whos Online $userid");
}
?>
What did i do wrong?