I don't think that will work.
A temporary fix for you would mostly likely be:
Code:
local sql = [[
REPLACE INTO books_settings
(bookid, profileid, cpage, npage, completed, opentime)
VALUES (?, 2, ?, ?, ?, ?)
]]
Until someone provides a fix to handle multiple profiles.
At pbterm this clunky line of code returns the current profile name:
Code:
profileName=$(readlink -f /mnt/ext1/system/profiles/.current); echo ${profileName##*/}
This works to get the variable into LUA:
(won't work if profiles never enabled/configured though)
Code:
local h1 = io.popen('test=$(readlink -f /mnt/ext1/system/profiles/.current); echo ${test##*/}')
local h2 = h1:read('*a')
-- removes newline
local profileName = h2:gsub('[\n\r]', '')
h1:close()