Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tVip doesn't auto create MySQL table #24

Open
Ironman1M opened this issue Jan 6, 2021 · 11 comments
Open

tVip doesn't auto create MySQL table #24

Ironman1M opened this issue Jan 6, 2021 · 11 comments

Comments

@Ironman1M
Copy link

Hi, after installing the plugin ( and setting up the database CORRECTLY ) and restarting the server multiple times the plugin says after every sm_addvip this.
`> sm_addvip "STEAM_1:0:583422896" 1 "Testikos" 0 a

Added 0:583422896 as VIP for 1 Month
L 01/06/2021 - 09:05:35: [tvip.smx] Table 'sql_5922.tVip' doesn't exist
L 01/06/2021 - 09:05:35: [tvip.smx] Table 'sql_5922.tVip' doesn't existAnd at startup this> L 01/06/2021 - 09:04:54: [SM] Exception reported: Invalid query Handle 0 (error: 4)
L 01/06/2021 - 09:04:54: [SM] Blaming: tvip.smx
L 01/06/2021 - 09:04:54: [SM] Call stack trace:
L 01/06/2021 - 09:04:54: [SM] [0] SQL_FetchRow
L 01/06/2021 - 09:04:54: [SM] [1] Line 488, C:\Users\Charles\CloudStation\Documents\Perso\Dev\tVip-1\tVip.sp::SQLCheckVIPQuery`

@Totenfluch
Copy link
Owner

use the version provided here on github and compile the .sp yourself. Then you will see what part of the database setup you failed.

@Ironman1M
Copy link
Author

Ironman1M commented Jan 7, 2021

I compiled it and still gives me this error on startup.
`> L 01/07/2021 - 22:59:08: [tvip.smx] Table 'sql_5922.tVip' doesn't exist

L 01/07/2021 - 22:54:55: [SM] Exception reported: Invalid query Handle 0 (error: 4)
L 01/07/2021 - 22:54:55: [SM] Blaming: tvip.smx
L 01/07/2021 - 22:54:55: [SM] Call stack trace:
L 01/07/2021 - 22:54:55: [SM] [0] SQL_FetchRow
L 01/07/2021 - 22:54:55: [SM] [1] Line 488, C:\Users\Charles\CloudStation\Documents\Perso\Dev\tVip-1\tVip.sp::SQLCheckVIPQuery`

@Ironman1M
Copy link
Author

Ironman1M commented Jan 7, 2021

It should autocreate the table in MySQL but it just doesn't, instead it shows the error

@Totenfluch
Copy link
Owner

it should print another error before.

SetFailState("Error connecting to database: "%s"", error);

@Ironman1M
Copy link
Author

Thew biggest problem here is that I don't know how to code plugins for CS:GO so I can't do it by myself.

@Ironman1M
Copy link
Author

But as I already said, it kust looks like it cant create the MySQL database table but the plugin itself works fine.

@Totenfluch
Copy link
Owner

execute the mysql statement manually on your database to get the correct error

@Ironman1M
Copy link
Author

I found the code I needed to execute on the database but now removing the vip's manually doesnt work

@ghost
Copy link

ghost commented Jan 25, 2021

Im having the same issue here:
L 01/25/2021 - 12:17:57: [tVip.smx] Table 'db826.tVip' doesn't exist L 01/25/2021 - 12:17:57: [SM] Exception reported: Invalid query Handle 0 (error: 4) L 01/25/2021 - 12:17:57: [SM] Blaming: tVip.smx L 01/25/2021 - 12:17:57: [SM] Call stack trace: L 01/25/2021 - 12:17:57: [SM] [0] SQL_FetchRow L 01/25/2021 - 12:17:57: [SM] [1] Line 488, C:\Users\Charles\CloudStation\Documents\Perso\Dev\tVip-1\tVip.sp::SQLCheckVIPQuery

I installed the latest version of tVIP from the github.

Here you can see a screenshot of my SQL:
GhkpXG3P
I also ran SET SQL_MODE='ALLOW_INVALID_DATES';
but sadly to no avail

@Ironman1M
Copy link
Author

Ironman1M commented Jan 26, 2021

I had problem with this too, all you gotta do is run this on your database to create the table.

CREATE TABLE IF NOT EXISTS tVip (
Id bigint(20) NOT NULL AUTO_INCREMENT,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
playername varchar(36) COLLATE utf8_bin NOT NULL,
playerid varchar(20) COLLATE utf8_bin NOT NULL,
enddate timestamp NOT NULL DEFAULT '2000-01-01 20:20:20',
admin_playername varchar(36) COLLATE utf8_bin NOT NULL,
admin_playerid varchar(20) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (Id),
UNIQUE KEY playerid (playerid)
) ENGINE = InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

@ghost
Copy link

ghost commented Jan 26, 2021

I had problem with this too, all you gotta do is run this on your database to create the table.

CREATE TABLE IF NOT EXISTS tVip (
Id bigint(20) NOT NULL AUTO_INCREMENT,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
playername varchar(36) COLLATE utf8_bin NOT NULL,
playerid varchar(20) COLLATE utf8_bin NOT NULL,
enddate timestamp NOT NULL DEFAULT '2000-01-01 20:20:20',
admin_playername varchar(36) COLLATE utf8_bin NOT NULL,
admin_playerid varchar(20) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (Id),
UNIQUE KEY playerid (playerid)
) ENGINE = InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

thanks wag1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants