Raised This Month: $ Target: $400
 0% 

Check if table exsits.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
erickvan
Junior Member
Join Date: Dec 2020
Old 05-29-2021 , 01:37   Check if table exsits.
Reply With Quote #1

Hello folks. Can someone do for me? I cant figure it out. I have code:

PHP Code:
public SavePlayerSession()
{
new 
g_maxplayers;
g_maxplayers get_maxplayers();
new 
p;
for(
1<= g_maxplayersp++)
{
if(
is_user_connected(p) && (<= get_user_team(p) <= 2))
{
new 
steam[64];
new 
szQuery[999];
new 
map_name[64];
get_mapname(map_name63)

get_user_authid(psteam63);
new 
szDirectory[128];
get_configsdirszDirectorycharsmaxszDirectory ) )
addszDirectorycharsmaxszDirectory ), "/id.txt" )

new 
size file_sizeszDirectory)  

new 
readMatchID[28], iLen

for ( new size i++ ) 

read_fileszDirectoryireadMatchIDcharsmaxreadMatchID ), iLen )
}
formatex(szQuery998"INSERT INTO `users_maps` (`steam_id`, `session_id`, `map` ) VALUES ('%s', '%s', '%s' );"steamreadMatchIDmap_name); 
SQL_ThreadQueryg_hTuple"QuerySetData"szQuery);
}
}
return 
PLUGIN_HANDLED;

Can someone make it: If steam_id and readMatchID exsits in the database just update not INSERT into? Thanks!

Last edited by erickvan; 05-29-2021 at 01:40.
erickvan 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 02:33.


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