Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Hi all i need help with my sql PLEAZE!!!!!

Author  Topic 

Breana
Starting Member

6 Posts

Posted - 2007-08-16 : 19:06:43
Hi al, :)
I am new here and i am having such a pain in my head here trying to get info from one of my tables.

I have a connection to it allready because i pull the members name and so on but when i try to pull the users current points it comes up blank?

i created a table called users, and name,lname,age,gender,points,scrore

i can pull info from all tables but points?
it has a default valuse of 5 points, and i want it to display the total points the have after they login..
Heres what i have maybe i messed up please look i need help :P

<?php
if (logincheck($uid, $upwd)) {
$accounttitle = "Welcome $uname";

$sql = "select points from users where userid = $uid";
$result = mysql_query($sql ,$db);
$mycount = mysql_num_rows($result);

if ($mycount == 1) {
$accountstat .= "You Have $points Points";

} else {
$accountstat .= "<font size=2 face='Arial, Helvetica, sans-serif'>Please login to view your stats</font>";
}
?><?php printf($accountstat); ?>

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-16 : 19:29:04
Is @uid a NUMBER or a NAME?

$sql = "select points from points where userid = '$uid'";

But beware of names like O'Sullivan etc.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Breana
Starting Member

6 Posts

Posted - 2007-08-16 : 19:39:18
oh hey i just updated my first post it was supost to be select points from users i ment...

anyone got an idea of how to fix this or get it working pretty please :)
Go to Top of Page
   

- Advertisement -