# item-system isnt working

## Recommended Posts

hey im trying to get a item-system to work but i keep getting a error in the console for this area of the script. i cant see whats wrong with it, on line 2

if not itemIndex then
local result = mysql_query( handler, "INSERT INTO items (type, owner, itemID, itemValue) VALUES (" .. getType( element ) .. "," .. getID( element ) .. "," .. itemID .. ",'" .. mysql_escape_string(handler, itemValue) .. ",')" )
if result then
itemIndex = mysql_insert_id( handler )
mysql_free_result( result )


here is the error i get in the console

[2012-01-23 02:52:33] ERROR: unzipped\item-system\s_item_management.lua:225: bad argument #1 to 'mysql_escape_string' (mysqlHandler expected, got nil)

Is "handler" a valid MySQL connection?

i think so its in the rest of the scripts and there working fine, but i couldnt really tell you lol im just trying to set up a server for my brother i cant script.

Well, that error means that the MySQL connection is nil.

hmm, but all the other resources are connected to MySQL, do you know any way i could fix it ?

This is a stupid question.What you mean by item-system,I have no clue what you need.Its section for scripting help not running unknown gamemodes

• MTA Team

He's running mabako's Paradise:MTA gamemode obviously.

Yeah you can fix it. Just fix the MySQL_Connection >.

its vedic but the guy i bought it from dosent provide any support for the errors he said all the resources work fine.

## Create an account

Register a new account