Raised This Month: $ Target: $400
 0% 

Register in the SQL if not already there?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-21-2007 , 19:06   Re: Register in the SQL if not already there?
Reply With Quote #1

An example:

Code:
new query[256], authid[32]
get_user_authid(id,authid,31)

format( query, 255, "INSERT INTO users (steamid, exp, level, kills) VALUES('%s','0','1','0') ON DUPLICATE KEY UPDATE exp=exp+%d, level=%d, kills=kills+%d", authid, exp, level, kills)
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-22-2007 , 02:58   Re: Register in the SQL if not already there?
Reply With Quote #2

JCobra: Idiot

On my karma page:
Quote:
Copied what I put with different values. Thumbs down
You didn't have the whole ON DUPLICATE KEY clause.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 01-22-2007 , 03:58   Re: Register in the SQL if not already there?
Reply With Quote #3

Quote:
Originally Posted by MaximusBrood View Post
An example:

Code:
new query[256], authid[32]
get_user_authid(id,authid,31)
 
format( query, 255, "INSERT INTO users (steamid, exp, level, kills) VALUES('%s','0','1','0') ON DUPLICATE KEY UPDATE exp=exp+%d, level=%d, kills=kills+%d", authid, exp, level, kills)
isn't exp the current experience level ? if so, you are adding the current level to the database one...(on duplicate)
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-22-2007 , 04:14   Re: Register in the SQL if not already there?
Reply With Quote #4

I'm not aware of how the system is actually working, I was just giving an example
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Reply



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 22:18.


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