Which way should I follow to get values from table which has a structure like:tIPtable = {
[curUser.sIP] = {
[curUser.sName] = {
["Entered"] = "LogInDate",
["Left"] = "LogOutDate",
},
},
}
I need to search for curUser.sIP and if it is found, get curUser.sName, Entered and Left values.
And also, I need to search for curUser.sName and if it is found, get curUser.sIP, Entered and Left values.
Thanks for any help..
example.
tIPtable = {
[curUser.sIP] = {
[curUser.sName] = {
["Entered"] = "LogInDate",
["Left"] = "LogOutDate",
},
},
}
if tIPtable[(curUser.sIP)] then
if tIPtable[(curUser.sIP)][(curUser.sName)] then
-- known username for the IP.
else
-- new username for the IP
end
else
-- build new table entry for IP
end
plop
I think you should have entered and left in a different table, since these change more frequently than IP, and is easier to maintain.
I only wanna get one entry & exit date per user in per ip. so that table is ok for now, I think