Raised This Month: $ Target: $400
 0% 

Simple SQL query to update points


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode