View Single Post
Author Message
rtk
Senior Member
Join Date: Dec 2009
Old 05-17-2014 , 19:36   Simple SQL query to update points
Reply With Quote #1

Firstly, I'm sorry to make such a dumb question.
I never got to play with SQL on SM before but I've been searching for some time and now I'm confused, specially with SQL_TQuery and callbacks.

All i need is a fast UPDATE query, so this should be easy.

In PHP it would look like this:
PHP Code:
function UpdatePlayerPoints($steamID64$amount)
{
    
$mysqli mysqli_connect(SQL_HOSTSQL_USERSQL_PWSQL_DB);
    if(!
$mysqli){
        return 
false;
    }

    
$result mysqli_query($mysqli"UPDATE `users` SET `points` = `points` + '{$amount}' WHERE `steamID64` = '{$sid64}'") or die(mysqli_error($mysqli));
    if(
$result){
        return 
true;
    } else {
        return 
false;
    }

    
mysqli_close($mysqli);

How would that look like ?

Thanks!
__________________
Never argue with an idiot. He lowers you to his level and then wins on experience!
rtk is offline