tmysql4 I can't make "Query" work?

Hello guys… :smile:

Okay so I got this kinda problem before, with tmysql4 not working so I hope someone can help.

This is what I’m trying to do:

function GM:Initialize ( )
	Msg("Loading tmysql module... ");
	if (tmysql) then
		Msg("Loaded tmysql module... 
		Msg("Failed to load tmsql module... 
	local db, err = tmysql.initialize("**IP**", "**USERNAME**", "**PASSWORD**", "**DATABASE**", **PORT**);
	if db then
        print("[MySQL] Connected to SV_DATABASE!
        SV_DATABASE = db
        print("[MySQL] Error connecting to SV_DATABASE:
    db = nil
    err = nil  

The problem is not to “connect” to the database that works just fine. This is my problem:

When I do:

SV_DATABASE:Query("UPDATE `system` SET `value`='" .. os.time() .. "' WHERE `key`='online_" .. GAMEMODE.ServerIdentifier .. "' LIMIT 1");

Just an example.

Then I get this error:

"calling 'Query' on bad self <<null> expected, got userdata>"

I know that this have been working, but now it doesn’t?

You have a very old and broken version of it.

Grab the latest here:

Oh okay thanks. I far as I remember I need to rename it from “gm_tmysql4_win32” to “gmsv_tmysql4_win32”, because if I doesn’t it won’t load it right?

EDIT: It’s working now. I had to get my hands on “msvcr110.dll” and “msvcp110.dll” to get it working.