MYSQL Database problem 2
#1

Hello guys, I have another problem with the database on mysql.
I gave someone level 1 admin on the server,then I restarted the server cause I made some changes,I looked in the database,and his level was still 0,not 1.Everything is well configured.
Thank you for reading,hope you can help me.
PS:My server is hosted.
Reply
#2

Hello!

Maybe it is a mistake in your save-function. Can you share this function with us?

- Mencent
Reply
#3

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

Maybe it is a mistake in your save-function. Can you share this function with us?

- Mencent :cool:
This?:
Код HTML:
//------------------------------------------------------------------
            //MySQL INSERT
            //------------------------------------------------------------------
			format(rQuery, 4096, "INSERT INTO `Accounts` (`ID`, `Name`, `Password`, `IP`, `E-Mail`, `LoggedIn`, `RegisterDate`, `LastOn`, `Level`, `VIP`, `Cash`, `Score`, `Coins`, `Credits`, \
											  `Headshots`, `Kills`, `Deaths`, `Hours`, `Minutes`, `Seconds`, `BestKillings`, `KillingSpree`, `FavSkin`, `UseSkin`, `House`, `Property`, \
											  `Description1`, `Description2`, `Description3`, `Positive`, `Negative`, `ClanID`, `ClanRank`, `ClanPoints`, `ClanKills`, `ClanDeaths`,");
			//------------------------------------------------------------------
			format(rQuery, 4096, "%s `Kicks`, `Bans`, `Jails`, `Warns`, `ClearChats`, `ReactionTest`, `MathTest`, `Mutes`, `Jailed`, `JailTime`, `Frozen`, `FreezeTime`, `Muted`, `MuteTime`, \
											  `RaceScore`, `StuntScore`, `DriftScore`, `GangID`, `GangRank`, `GangSkin`, `GangKills`, `GangDeaths`, `GangWarns`, `GangCaptures`, `GangPoints`, \
											  `Ignores`, `LottoNumber`, `C4`, `StatsNote`, `VIPTime`, `FreeVIP`, `TempVIP`, `RLSClan`, `RLSRank`, `AdmWarns`, `VIPWarns`, `KickW`)", rQuery);
			//------------------------------------------------------------------
			format(rQuery, 4096, "%s VALUES (0, '%s', '%s', '%s', 'changeme@etrion.ro', '1', '%02d/%02d/%02d', '%02d/%02d/%02d', \
											'0', '0', '25000', '100', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '217', '1', '0', '0', \
											' ', ' ', ' ', '0', '0', '0', '0', '0', '0', '0', \
											'0', '0', '0', '0', '0', '0', '0', '0', '0', '00:00', '0', '00:00', '0', '00:00', \
											'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \
											'0/0/0/0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0')", rQuery, PlayerName(playerid), rPassword, GetPlayerIPEx(playerid), liDay, liMonth, liYear, liDay, liMonth, liYear);
			//------------------------------------------------------------------
			mysql_tquery(DB_Connect, rQuery, "OnAccountCreated", "i", playerid);
			//------------------------------------------------------------------
Reply
#4

Check the mysql logs (in case it fails to update on disconnect or when the command is used) + use default values in those fields you know their initial value in INSERT statement. By doing that, it will reduce the query a lot.
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Check the mysql logs (in case it fails to update on disconnect or when the command is used) + use default values in those fields you know their initial value in INSERT statement. By doing that, it will reduce the query a lot.
I change the values that I provided above which are in gamemode?
What do I change them to?
I'm a newbie on samp scripting, so I'm asking you to help me step by step if you want to of course.
Reply
#6

If you set the admin level of the user, do you save it to the database with a UPDATE query?
Reply
#7

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
If you set the admin level of the user, do you save it to the database with a UPDATE query?
Shouldn't it be saving automatically?
By the way, I don't even what query is.
Reply
#8

No, nothing in your server is saving automatically. You have to save it either by a timer running every x seconds/minutes or by executing a query when an action has performed.
Reply
#9

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
No, nothing in your server is saving automatically. You have to save it either by a timer running every x seconds/minutes or by executing a query when an action has performed.
Okay,I got it,now the question is,how do I execute a query?
Reply
#10

Quote:
Originally Posted by darkowner
Посмотреть сообщение
Okay,I got it,now the question is,how do I execute a query?
Quote:
Originally Posted by darkowner
Посмотреть сообщение
This?:
Код HTML:
//------------------------------------------------------------------
            //MySQL INSERT
            //------------------------------------------------------------------
			format(rQuery, 4096, "INSERT INTO `Accounts` (`ID`, `Name`, `Password`, `IP`, `E-Mail`, `LoggedIn`, `RegisterDate`, `LastOn`, `Level`, `VIP`, `Cash`, `Score`, `Coins`, `Credits`, \
											  `Headshots`, `Kills`, `Deaths`, `Hours`, `Minutes`, `Seconds`, `BestKillings`, `KillingSpree`, `FavSkin`, `UseSkin`, `House`, `Property`, \
											  `Description1`, `Description2`, `Description3`, `Positive`, `Negative`, `ClanID`, `ClanRank`, `ClanPoints`, `ClanKills`, `ClanDeaths`,");
			//------------------------------------------------------------------
			format(rQuery, 4096, "%s `Kicks`, `Bans`, `Jails`, `Warns`, `ClearChats`, `ReactionTest`, `MathTest`, `Mutes`, `Jailed`, `JailTime`, `Frozen`, `FreezeTime`, `Muted`, `MuteTime`, \
											  `RaceScore`, `StuntScore`, `DriftScore`, `GangID`, `GangRank`, `GangSkin`, `GangKills`, `GangDeaths`, `GangWarns`, `GangCaptures`, `GangPoints`, \
											  `Ignores`, `LottoNumber`, `C4`, `StatsNote`, `VIPTime`, `FreeVIP`, `TempVIP`, `RLSClan`, `RLSRank`, `AdmWarns`, `VIPWarns`, `KickW`)", rQuery);
			//------------------------------------------------------------------
			format(rQuery, 4096, "%s VALUES (0, '%s', '%s', '%s', 'changeme@etrion.ro', '1', '%02d/%02d/%02d', '%02d/%02d/%02d', \
											'0', '0', '25000', '100', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '217', '1', '0', '0', \
											' ', ' ', ' ', '0', '0', '0', '0', '0', '0', '0', \
											'0', '0', '0', '0', '0', '0', '0', '0', '0', '00:00', '0', '00:00', '0', '00:00', \
											'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \
											'0/0/0/0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0')", rQuery, PlayerName(playerid), rPassword, GetPlayerIPEx(playerid), liDay, liMonth, liYear, liDay, liMonth, liYear);
			//------------------------------------------------------------------
			mysql_tquery(DB_Connect, rQuery, "OnAccountCreated", "i", playerid);
			//------------------------------------------------------------------
Like this. You can check the parameters on the sa-mp wiki for the plugin you are using
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)