Raised This Month: $ Target: $400
 0% 

Save player data to mysql


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-31-2018 , 11:07   Re: Save player data to mysql
Reply With Quote #1

Use update instead of replace.
https://www.w3schools.com/sql/sql_update.asp

Also, you do not need to specify all columns if you set values in correct order, and format with %i for integers instead of %d.

Code:
INSERT INTO 'users' VALUES ('%s', '%s', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', NOW());", steam, GetSecureName(Name), pKills[id], pDeaths[id], pHeadshots[id], pAces[id], pMiniAces[id], pMixPlayed[id], pMixLost[id], pMixWon[id], pMixDraw[id], pPoints[id]);

More info about sql: https://forums.alliedmods.net/showth...p?t=172936#SQL
__________________









Last edited by CrazY.; 05-31-2018 at 11:16.
CrazY. 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 04:43.


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