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

watkins577

As3, lua, xml scripter
Joined
Sep 20, 2008
Messages
130
Reaction score
0
I have a offer = db.getResult("SELECT * FROM `auction_system`") and Im trying to access the rows of 'offer' from there so I can list them in an FYI thing.

How can I carry on with this?
 
What exactly you want to do?

Display all offers / display specified offer?

I suppose you're trying to do first option, so here's an example:
Lua:
local auctions = db.getResult("SELECT * FROM `auction_system`")
if(auctions:getID() == -1)
	error('result not set!')
	return true
end

local str = ""
repeat
	str = "\n" .. str .. auctions:getDataString("item_name")
until not(auctions:next())
auctions:free()

doPlayerPopupFYI(cid, "Auction list: " .. str)
 
Last edited:
Back
Top