Thanks for the help but maybe you could help me with some lua.
function erayan.doCheckGroup(name, inherit_from, displayname, can_target)
if not erayan.database.state == 0 then
notifyerror( 'SQL Connection not open.' )
return false
else
if inherit_from == nil then
inherit_from = ''
end
if can_target == nil then
can_target = ''
end
local queryText = erayan.queries['select_group']:format(name,erayan.config.server)
print( 'EraYaN: ','Query',queryText)
local query = erayan.database:query(queryText)
if (query) then
query.onFailure = erayan.checkGroupOnFailure
query.onSuccess = erayan.checkGroupOnSuccess
query.onData = erayan.checkGroupOnData
query.name = name
query.inherit_from = inherit_from
query.displayname = displayname
query.can_target = can_target
query:start()
print( 'EraYaN: ','-----------------------Checking Group-----------------------')
else
table.insert(erayan.database.pending, {queryText})
CheckStatus()
print( 'EraYaN: ','-----------------------Check Group Query Pending-----------------------')
end
end
end
function erayan.checkGroupOnFailure(self, err)
notifyerror( 'SQL Check Group Fail ', err )
end
function erayan.checkGroupOnSuccess()
print( 'EraYaN: ', '-----------------------Checked Group----------------------- ')
end
function erayan.checkGroupOnData(self, datarow)
print( 'EraYaN: ','-----------------------Recieved Group Data----------------------- ')
print( 'EraYaN: ','DataRow', datarow['Hits'])
print( 'EraYaN: ',type(datarow['Hits']),datarow['Hits'])
if datarow['Hits'] == "0" then
print( 'EraYaN: ','-----------------------Adding group...----------------------- ')
erayan.doAddGroup( self.name, self.inherit_from, self.displayname, self.can_target )
else
print( 'EraYaN: ','-----------------------Updating group...----------------------- ')
erayan.doUpdateGroup( datarow['ulibGroupID'], self.inherit_from, self.displayname, self.can_target )
end
end
it runs the first function (as it should) and prints
EraYaN: Query <query here>
EraYaN: -----------------------Checking Group-----------------------
it works on my users so I dont get why it doesn't call the callbacks
EDIT: the queries are ok they run fine in MySQL workbench
EDIT2: checked again, queries run but callbacks aren't called