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

Inserting data from database to a table.

wesoly136

Member
Joined
Jul 30, 2009
Messages
562
Reaction score
8
Hi!
Operating with databse queries is difficult for me :S
How to insert for example: all ids of guild owners to a table?
I tried something like that:
Code:
local owners = db.getResult("SELECT `ownerid` FROM `guilds`;")
local list = {}
	for i, tid in ipairs(owners) do
	list[i] = tid
end
But with no effect, no error in console.
 
you are manipulating Lua tables
to insert into SQL table use db.executeQuery with INSERT INTO statement

also you aren't fetching result properly (or at all), see deathlist/frags talkaction for details
 
I just need to check if the loging in player is a leader of any guild, but I also wanted to know how to do that :p
EDIT
Solved my problem in other way :p
 
Last edited:
next time write what you're trying to achieve in the main post.

proper condition is getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER
 
Back
Top