Jump to content
Sign in to follow this  
colcrt

unfinished string near ´"

Recommended Posts

quest test begin
	state start begin
		when letter with pc.is_gm() begin
			send_letter (" GM: test")
		end

		when button or info begin
		
			local query = [[
			SELECT player.player.name as m_name, player.player.level as m_level, player.player.exp as m_exp
			FROM player.player, account.account
			WHERE
				player.player.name not like '[%]%' AND
				date_sub(now(), interval 1 day) < player.player.last_play AND
				player.player.account_id=account.account.id AND
				account.account.status='OK'
			ORDER BY player.player.level DESC, player.player.exp DESC, player.player.name ASC
			LIMIT 10;
			]]
			
			local res1, res2 = mysql_direct_query(query)
			say_title("Top "..res1.." players")
			for num1, str1 in ipairs(res2) do
				say_reward(num1.."\t"..str1.m_name.."\t"..str1.m_level.."\t"..str1.m_exp)
		end
	end
end

 

Share this post


Link to post
Share on other sites
hace 6 horas, Shang dijo:

La query es una string no un array. Btw el for en lua también se cierra con un end.

podría dejarme un ejemplo no logro hacerla funcionar pese a las correcciones 😕 pls

Share this post


Link to post
Share on other sites
hace 11 horas, colcrt dijo:

podría dejarme un ejemplo no logro hacerla funcionar pese a las correcciones 😕 pls

local c, query = mysql_direct_query("SELECT id FROM player.player")
for i = 1, c do
	syschat("Id: "..query[i].id)
end

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...