• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to work if db.query, example, if that return a empty value?

jonathan.dsa

New Member
Joined
Nov 17, 2011
Messages
61
Reaction score
0
Hello, i have made a script for find in a table if this guild already registred or not, but return that error: '[Result:getDataString] Result not set!', where is the problem on my script? :
Lua:
        guild = getPlayerGuildId(cid)
	chck = db.getResult("SELECT `guild_id` FROM `rookwar.guild` WHERE `guild_id` = '"..guild.."' LIMIT 1;")
	if (chck:getID() ~= -1) then
		chcar = check:getDataString('guild_id')
		chck:free()
	end
	if guild ~= chcar then
		db.executeQuery("INSERT INTO `rookwar` (`player`) VALUES ('" ..nome.. "');")
	end

- - - Updated - - -

the error is on that line:
Lua:
chcar = check:getDataString('guild_id')

- - - Updated - - -

how work if empty result?
 
Last edited:
Back
Top