table.insert problem LUA Code pls help

01/12/2014 14:52 agronaque512#1
Hi guys,

I've some problems with this code:

Code:
local names_list_s = mysql_query("SELECT * FROM player.vote_member WHERE empire = 'SHINSOO'; ")
						local names_list_table = {}
						for i = 1,table.getn(names_list_s),1 do
							table.insert(names_list_table,names_list_s.name[i])
						end
						table.insert(names_list_table,"Close")
						if(table.getn(names_list_s) == 0) then
							say("Error! ")
							say("Returning ...")
						end
						local m = select_table(names_list_table)
						if(table.getn(names_list_table) == s) then
							return
						elseif(table.getn(names_list_table) >= s) then
							say_title(names_list_s.name[m]..": ")
							say("")
							---
							say(names_list_table[m])
							say("")
							say_reward("You wanna vote for him? ")
							local q = select(locale.yes,locale.no)
							if(q == 2) then
								mysql_query("UPDATE player.vote_member SET vote=vote+1 WHERE name = '"..names_list_s.name[m].."'; ")
								pc.setqf("vote", 1)
								chat("Good one  !")
							end
						end
That won't work :(
It just do the first menu like this

Vote:
Name1
name2
name3
name4
Close

But when i click up to any menu, that's returning and do nothing else...
It suppos to show me that first :
Code:
say_title(names_list_s.name[m]..": ")
							say("")
							---
							say(names_list_table[m])
							say("")
							say_reward("You wanna vote for him? ")
But it just returning to the game...
01/13/2014 18:03 agronaque512#2
UP pls !
01/13/2014 19:12 Noa_#3
if(table.getn(names_list_table) == s) then

"s" ist not defined
01/13/2014 19:29 agronaque512#4
and what i'm suppos to write to work ?
Cause i've try to replace this "s" by "m" or "names_list_table " or "names_list_s" ... well nothing working... When i just clic on one name, that's end that's all

Any suggestions?

In fact bro,

i need to replace this "s" like u said but i want this "s" be the "Close" option you see? Like if the guy clic "Close" then end and if not then (all the rest) can you help me ?

up pls

Solved ! Thanks to Noa