Jump to content

Problem with gridlist


Michcio

Recommended Posts

Theres no data in columns 2 - 5.

local wnetrza = { -- I don't really use tables 
    [1] = "223.0538482666, 1287.3552246094, 1082.140625, 1, Shitty house 1", 
    [2] = "2233.6594238281, -1114.9837646484, 1050.8828125, 5, Hotel room 1", 
    [3] = "2365.22265625, -1135.5612792969, 1050.8825683594, 8, Modern house 1", 
    [4] = "2282.9401855469, -1140.1246337891, 1050.8984375, 11, Hotel room 2", 
    [5] = "2196.7075195313, -1204.3569335938, 1049.0234375, 6, Modern house 2", 
    [6] = "2270.0834960938, -1210.4854736328, 1047.5625, 10, Modern house 3", 
    [7] = "2308.755859375, -1212.5498046875, 1049.0234375, 6, Shitty house 2", 
    [8] = "2217.7729492188, -1076.2110595703, 1050.484375, 1, Hotel room 3", 
    [9] = "2237.5009765625, -1080.9367675781, 1049.0234375, 2, Good house 1", 
    [10] = "2317.7609863281, -1026.4268798828, 1050.2177734375, 9, Good Stair house 1", 
    [11] = "261.05038452148, 1284.7646484375, 1080.2578125, 4, Goood house 2", 
    [12] = "140.18000793457, 1366.7183837891, 1083.859375, 5, Modern house 4(Rich)", 
    [13] = "83.037002563477, 1322.6156005859, 1083.8662109375, 9, Good Stair house 2", 
    [14] = "-283.92623901367, 1471.0096435547, 1084.375, 15, Good Stair house 3", 
    [15] = "-261.03778076172, 1456.6539306641, 1084.3671875, 4, Good Stair house 4", 
    [16] = "-42.609268188477, 1405.8033447266, 1084.4296875, 8, Shitty house 3", 
    [17] = "-68.839866638184, 1351.4775390625, 1080.2109375, 6, Shitty house 4", 
    [18] = "2333.068359375, -1077.0648193359, 1049.0234375, 6, Shitty house 5", 
    [19] = "1261.1168212891, -785.38037109375, 1091.90625, 5, Mad Doggs Mansion", 
    [20] = "2215.1145019531, -1150.4993896484, 1025.796875, 15, Jefferson Motel", 
    [21] = "2352.4575195313, -1180.9454345703, 1027.9765625, 5, Burning desire house(Buggy)", 
    [22] = "421.94845581055, 2536.5021972656, 10, 10, Abandoned Tower", 
    [23] = "2495.9753417969, -1692.4174804688, 1014.7421875, 3, Johnson house", 
    [24] = "-2158.7209472656, 642.83074951172, 1052.375, 1, Bet Interior", 
    [25] = "1701.1682128906, -1667.759765625, 20.21875, 18, Atrium lobby", 
    [26] = "2324.499, -1147.071, 1050.71, 12, Modern House 5(Rich)", 
    [27] = "244.411987,305.032989,999.148437, 1, 1 Room house", 
    [28] = "271.884979,306.631988,999.148437, 2, 1 Room house", 
    [29] = "302.180999,300.722991,999.148437, 4, 1 Room house", 
} 
  
  
        for i,data in ipairs (wnetrza) do 
            row = guiGridListAddRow(intgrid) 
            guiGridListSetItemText(intgrid, row, icol1, tostring(i), false, true) 
            guiGridListSetItemText(intgrid, row, icol2, data[1], false, false) 
            guiGridListSetItemText(intgrid, row, icol3, data[2], false, false) 
            guiGridListSetItemText(intgrid, row, icol4, data[3], false, false) 
            guiGridListSetItemText(intgrid, row, icol5, data[4], false, false) 
        end 
  

Edited by Guest
Link to comment

Sorry for spam but I don't know that it will create so much topics.

Edit:

The problem solved, but I have another problem with MySQL and I don't know why. Debug outputs:

[2013-02-15 14:42:16] INFO: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int, dim, wlasciciel, nick, cena, bank, czynsz, ilnaj, koszt) VALUES ('-2665.070' at line 1 

    local insertid,e = exports.sql:query_insertid( "INSERT INTO domy ( x, y, z, ix, iy, iz, int, dim, wlasciciel, nick, cena, bank, czynsz, ilnaj, koszt) VALUES (" .. table.concat( { "'"..tonumber(x).."'", "'"..tonumber(y).."'", "'"..tonumber(z).."'", "'"..tonumber(ix).."'", "'"..tonumber(iy).."'", "'"..tonumber(iz).."'", "'"..tonumber(int).."'", 0, "'"..tonumber(wlasciciel).."'", "'"..nick.."'", "'"..tonumber(cena).."'", "'"..tonumber(bank).."'", 0, 0, 0 }, ", " ) .. ")" ) 
  

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...