[SOLVED] Changing user pictures

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

it should have

Post by fresh »

the points row is there, the username is there, users is the right name... is there anyother reason for this??
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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?
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

it says

Post 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 :)
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

hey

Post 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 :)
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

hey

Post 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 :)
Post Reply