Page 2 of 2

it should have

Posted: Fri Jul 16, 2004 6:14 am
by fresh
the points row is there, the username is there, users is the right name... is there anyother reason for this??

Posted: Fri Jul 16, 2004 6:16 am
by feyd
what does changing the line

Code: Select all

$query = "SELECT `points` FROM `users` WHERE `username` = '$name'"; 

// to

echo $query = "SELECT `points` FROM `users` WHERE `username` = '$name'";
output?

it says

Posted: Fri Jul 16, 2004 6:29 am
by fresh
SELECT `points` FROM `users` WHERE `username` = ''
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 11 in /home/hackinou/public_html/members/mypage.php on line 8
houston, we have a problem!

thanks :)

hey

Posted: Fri Jul 16, 2004 6:36 am
by fresh
I know what that means you told me before, the var wasn't being passed, I saw I was spelling the column title wrong, and it's fixed... thanks feyd :)

hey

Posted: Sat Jul 17, 2004 7:55 pm
by fresh
i noticed that it does update the ranks just to big boy and never updates when the user gets enough points to become the man, heres my code:

Code: Select all

// add points to users points row
$sql = "
UPDATE `users` SET `points` = `points` + '{$pts}',
`rank` = IF( `points` >= 20000, 'the man', `rank` ),
`rank` = IF( `points` >= 10000, 'big boy', `rank` ),  <-- stops here
`rank` = IF( `points` >= 4000, 'baby', `rank` )
WHERE `username` = '{$uname}'";

@mysql_query($sql) or die(mysql_error());
any ideas of why... thanks :)