Raised This Month: $51 Target: $400
 12% 

upload vault content to mysql


Post New Thread Reply   
 
Thread Tools Display Modes
eat1k
Senior Member
Join Date: Apr 2018
Old 02-03-2019 , 15:04   Re: upload vault content to mysql
Reply With Quote #11

Quote:
Originally Posted by TheBladerX View Post
That is for what?
To avoid SQL injections.
__________________
eat1k is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 02-04-2019 , 12:37   Re: upload vault content to mysql
Reply With Quote #12

Edit:

Okay, the issue is this:
This is my nvault
Code:
public ZapiszDane(id)
{
	new vaultkey[64],vaultdata[256];
	format(vaultkey,63,"%s-%i-cod", nazwa_gracza[id], klasa_gracza[id]);
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i#%i", doswiadczenie_gracza[id], poziom_gracza[id], inteligencja_gracza[id], zdrowie_gracza[id], wytrzymalosc_gracza[id], kondycja_gracza[id], bonus_gracza[id], monety[id], ochrona_gracza[id]);
	nvault_set(g_vault,vaultkey,vaultdata);
}
and I would like to JUST upload (not read) following:
nazwa_gracza[id], klasa_gracza[id], poziom_gracza[id]

all upload here:
Code:
new Host[]     = "blablaip"
new User[]    = "user"
new Pass[]     = "pass"
new Db[]     = "dbname"

Last edited by TheBladerX; 02-04-2019 at 15:16.
TheBladerX is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-04-2019 , 18:24   Re: upload vault content to mysql
Reply With Quote #13

Why not insert into db directly from variables when the player is disconnecting, or something?
PHP Code:
formatexszBuffer charsmaxszBuffer "INSERT INTO tblHello (nazwa, klasa, poziom) VALUES (%d,%d,%d);" nazwa_gracza[id], klasa_gracza[id], poziom_gracza[id] ); 
__________________
Bugsy is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 02-04-2019 , 19:25   Re: upload vault content to mysql
Reply With Quote #14

Quote:
Originally Posted by Bugsy View Post
Why not insert into db directly from variables when the player is disconnecting, or something?
PHP Code:
formatexszBuffer charsmaxszBuffer "INSERT INTO tblHello (nazwa, klasa, poziom) VALUES (%d,%d,%d);" nazwa_gracza[id], klasa_gracza[id], poziom_gracza[id] ); 
Because I did not know the structure. Thank you for your help. This one helped too https://forums.alliedmods.net/showthread.php?t=307920
TheBladerX 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 12:49.


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