Jump to content

Загрузка данных


Recommended Posts

Доброго времени суток.

Имеется код:

local query = dbQuery(connect, "SELECT * FROM `users` WHERE `name`=? and `password`=?", username, password) 
local result = dbPoll(query, -1) 
if #result ~= 0 then 
    ..... 
end 

Как получить данные из запроса?

Link to comment
Доброго времени суток.

Имеется код:

local query = dbQuery(connect, "SELECT * FROM `users` WHERE `name`=? and `password`=?", username, password) 
local result = dbPoll(query, -1) 
if #result ~= 0 then 
    ..... 
end 

Как получить данные из запроса?

http://en.wikipedia.org/wiki/Hash_table

http://en.wikipedia.org/wiki/Structure

http://en.wikipedia.org/wiki/Lua_(programming_language)#Tables

Link to comment
  • Other Languages Moderators
local query = dbQuery(connect, "SELECT * FROM `users` WHERE `name`=? and `password`=?", username, password) 
local result = dbPoll(query, -1) 
if #result ~= 0 then 
    ..... 
end 

local query = dbQuery(connect, "SELECT * FROM `users` WHERE `name`=? and `password`=?", username, password) 
local result = dbPoll(query, -1) 
if #result ~= 0 then 
    ..... 
end 
for k,row in pairs (result) do 
    outputChatBox (row ["name"]) 
end 
  

может это сработает?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...