Raised This Month: $ Target: $400
 0% 

Solved Write same thing but to 2 databases/tables


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-18-2018 , 15:27   Re: Write same thing but to 2 databases/tables
Reply With Quote #4

Quote:
Originally Posted by 4ever16 View Post
Dont understant what you mean but i use only one database. I just want it to write same thing but to 2 tables not 2 different databases.
Code:
public SavePlayer(id)
{    
    if (pPoints[id] < 0)
        pPoints[id] < 0;
    
    new Name[64], steam[35];
    get_user_name(id, Name, 34);
    
    get_user_authid(id, steam, 34);
    
    new szQuery[3800];
    formatex( szQuery, 3799, "REPLACE INTO `DATABASETABLE1` (`player_id`, `player_name`, `kills`, `deaths`, `headshots`, `aces`, `m_aces`, `mix_played`, `mix_lost`, `mix_won`, `mix_draw`, `points`, `last_online`) VALUES ('%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', NOW());", steam, GetSecureName(Name), pKills[id], pDeaths[id], pHeadshots[id], pAces[id], pMiniAces[id], pMixPlayed[id], pMixLost[id], pMixWon[id], pMixDraw[id], pPoints[id]);
    SQL_ThreadQuery( g_hTuple, "QuerySetData", szQuery);
    
    formatex( szQuery, 3799, "REPLACE INTO `DATABASETABLE2` (`player_id`, `player_name`, `kills`, `deaths`, `headshots`, `aces`, `m_aces`, `mix_played`, `mix_lost`, `mix_won`, `mix_draw`, `points`, `last_online`) VALUES ('%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', NOW());", steam, GetSecureName(Name), gKills[id], gDeaths[id], gHeadshots[id], gAces[id], gMiniAces[id], gMixPlayed[id], gMixLost[id], gMixWon[id], gMixDraw[id], gPoints[id]);
    SQL_ThreadQuery( g_hTuple, "QuerySetData", szQuery);
        
    #if AMXX_VERSION_NUM >= 183 
        SQL_SetCharset(g_hTuple,"utf8"); // WTF?
    #endif
}
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-18-2018 at 15:29.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 



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 12:49.


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