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
Author Message
4ever16
Veteran Member
Join Date: Apr 2015
Old 06-18-2018 , 14:57   Write same thing but to 2 databases/tables
Reply With Quote #1

So basicly i want to write data to both databases/tables.
The wierd thing is that it only writes to database2.
I want it to write to both what am i doing wrong?

PHP Code:
public SavePlayer(id)
{
    if(!
pLoaded[id]) return PLUGIN_HANDLED;
    
    if (
pPoints[id] < 0)
        
pPoints[id] < 0;
    
    new 
Name[64], steam[64];
    
get_user_name(idName63);
    
    
get_user_authid(idsteam63);
    
    static 
szQuery[3800];
    
formatexszQuery3799"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());"steamGetSecureName(Name), pKills[id], pDeaths[id], pHeadshots[id], pAces[id], pMiniAces[id], pMixPlayed[id], pMixLost[id], pMixWon[id], pMixDraw[id], pPoints[id]);
    
formatexszQuery3799"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());"steamGetSecureName(Name), gKills[id], gDeaths[id], gHeadshots[id], gAces[id], gMiniAces[id], gMixPlayed[id], gMixLost[id], gMixWon[id], gMixDraw[id], gPoints[id]);
            
    
#if AMXX_VERSION_NUM >= 183
        
SQL_SetCharset(g_hTuple,"utf8");
    
#endif
    
    
SQL_ThreadQueryg_hTuple"QuerySetData"szQuery);

    return 
PLUGIN_CONTINUE;


Last edited by 4ever16; 06-18-2018 at 16:21.
4ever16 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 12:48.


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