• 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!

SQL Query Problem

Status
Not open for further replies.

Scarlet Ayleid

Advanced OT User
Senator
Joined
Jul 7, 2007
Messages
4,049
Reaction score
239
Hello ^^

I have a problem when executing a SQL Query from a LUA script, it won't show any error, it just won't work.

Script:
Code:
function onSay(cid, words, param)
	local exp = databaseQuery("SELECT `experience` FROM `players` WHERE `name` ='" .. getPlayerName(cid) .. "'")
	doPlayerSendTextMessage(cid, 24, "You have " .. exp .. " exp.")
	return TRUE
end

Result:
22:10 You have 1 exp.
22:10 GOD Quetzalma [201]: checkexp
22:10 You have 2 exp.
22:10 GOD Quetzalma [201]: checkexp
22:10 You have 3 exp.
22:10 GOD Quetzalma [201]: checkexp
22:10 You have 4 exp.
22:10 GOD Quetzalma [201]: checkexp
22:10 You have 5 exp.
22:10 GOD Quetzalma [201]: checkexp

whats the problem in here?


IMAGE
 
Last edited:
problem solved

Code:
local result = databaseQuery("SELECT `experience` FROM `players` WHERE `name` ='" .. getPlayerName(cid) .. "';")
local exp = getResultField(result, "experience")
 
Status
Not open for further replies.
Back
Top