I encountered a few problems with getElementData and mysql_escape_string.
For some odd reason, this line is giving me 2 warning/errors:
local name = mysql_escape_string(serversql, getElementData(id, "name"))
mysql_escape_string is from a module but it's well used. The error says "Bad Argument @ 'getElementData'". How?
"id" is going through a loop under an element that I created.
for id in ipairs(getElementsByType("customelement")) do
And of course the element is created before the function is called(this is called when the resource stops and the element is created when the resource starts). That's how I made it:
local id = createElement("customelement", row[2])
What is wrong?
My other problem is pretty similar. when I try to compare getElementData, it says also bad argument. I suppose it's related.