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!
$sql = "UPDATE `users` SET `points` = `points`+ {$pts} WHERE `username` = '{$uname}'";
@mysql_query($sql) or die(mysql_error());
as you can see Im writing the value of $pts to the points row of a specified user, via the var $uname... my question is, once the points have been added, I need a script that checks that same points row, for that same user and if the points are lets say higher than 1000 then, the script I need would update the row, rank, replacing the default value of new guy, to lets say big guy, or something... can some one show me some example scripts for this??? thanks in advance
alright that works thank you... so why wouldnt you throw that in the db?? and also, is it possible to add multiple if statements to that same query string?? I need to check to see if they qualify for atleast 3 more rank levels... thanks feyd
that seems pretty crazy... i think I will stick with what I have now, lol
hey feyd, could you show me how to add more if statements to that same string (the one above your last post), would I use ||, &&, or else??? and would it need to be on all one line and in the same format??? thanks man
thanks alot feyd I'll give them both a shot, I appreciate the help man
edit: feyd, I tested it and it gave me this error:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `username` = 'test'' at line 5
thanks for that link, but I dont understand the way they explain the syntax, I need examples because I don't get it otherwise, Im the same way with batch and the way they explain that syntax...