[Plugin] Homes Plugin!?
#7
Ok, still doing this, but i ran into an issue.

I want to do a sqlite query to get a list of tables. But somehow i am not able to return the query result.

The query function gets the playername as argument and should return a table of tables (a_List):
function cStorage:GetList( player )
    
    local a_List = {}
    
    -- get data from query
    function getResult(udata, cols, values, names)
        
        for i=1,cols do print(\'\',names[i],values[i]) end
        
        return 0
    end
    
    -- get all player homes
    local sql = "SELECT * FROM " .. PluginName .. " WHERE Player=\'" .. player .. "\'"
    self:DBExec(sql, getResult) 
    return a_List 
end


This is a sample result which should go into the table:
        ID      1
        Player  no_use_for_name
        Name    default
        World   world
        X       -68.877814274714
        Y       64
        Z       205.5105932393
        ID      2
        Player  no_use_for_name
        Name    hill
        World   world
        X       -66.54712734459
        Y       64
        Z       209.61457523444
        ID      3
        Player  no_use_for_name
        Name    hil
        World   world
        X       -66.54712734459
        Y       64
        Z       209.61457523444

I would expect something like:
a_List = {{row1,...}, {row2,...}...}

But maybe there is a better way?! I tried several things already, but didnt get it yet. Returning a single result is easy.

Any help would be nice
Reply
Thanks given by:


Messages In This Thread
[Plugin] Homes Plugin!? - by nouseforname - 11-25-2014, 05:20 AM
RE: [Plugin] Homes Plugin!? - by NiLSPACE - 11-25-2014, 05:22 AM
RE: [Plugin] Homes Plugin!? - by sphinxc0re - 11-25-2014, 05:46 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-25-2014, 06:23 AM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-25-2014, 06:28 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-25-2014, 07:18 AM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-26-2014, 04:27 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-26-2014, 06:05 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-26-2014, 06:09 AM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-26-2014, 06:15 AM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-27-2014, 01:25 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-26-2014, 06:12 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-27-2014, 02:56 AM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-27-2014, 03:04 AM
[Plugin] Homes RC1 - by nouseforname - 11-27-2014, 05:44 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-27-2014, 06:27 AM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-27-2014, 01:41 PM
RE: [Plugin] Homes Plugin!? - by xoft - 11-27-2014, 06:44 AM
RE: [Plugin] Homes Plugin!? - by bearbin - 11-27-2014, 05:44 PM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-27-2014, 05:47 PM
RE: [Plugin] Homes Plugin!? - by xoft - 11-27-2014, 07:43 PM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-28-2014, 01:52 AM
RE: [Plugin] Homes Plugin!? - by xoft - 11-28-2014, 02:58 AM
RE: [Plugin] Homes Plugin!? - by nouseforname - 11-28-2014, 03:33 AM



Users browsing this thread: 1 Guest(s)