Jump to content

[Help] Mysql Save job


kamani

Recommended Posts

Hi all :)

my job save script is wrong, in server console (when quit of game) i get:

attempt to concatenate global 'job' (a boolean value)

This is code: (Server)

function savejob()
local nick = getPlayerName( source )
local job = getPlayerTeam( source )
local savequery = "UPDATE users SET jobname='" .. job .. "'  WHERE username='" .. nick .."'"
end
addEventHandler ( "onPlayerQuit", getRootElement(), savejob)

Link to comment
Also, making a variable named "query" does not magically create a database connection, query it and return results.. for MySQL you need a separate module, for MTA's built-in SQLite database, you still need to call functions.

I can't believe how I missed that part xD

Here's the two MySQL modules by the way:

https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL

https://wiki.multitheftauto.com/wiki/Modules/MySQL

I personally recommend MTA-MySQL.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...