i am new to database, I am following the turorias but im stuck. I was wondering if the following code is written correctly or if even possible. please help.
[code]
TextField = native.newTextField( 50, 150, 220, 36, handlerFunction )
local testvalue = {}
local function AddSQL(tap)
testvalue[1] = “’”… TextField.text … “’”
local insertQuery = [[INSERT INTO estudiantes VALUES (NULL, testvalue[1],‘This is an unknown person.’, ‘1234’, ‘09231990’); ]]
db:exec( insertQuery )
– Hide keyboard
native.setKeyboardFocus( nil )
end
botonInsert:addEventListener(“tap”,AddSQL)
local function ShowSQL(tap)
for row in db:nrows(“SELECT * FROM estudiantes”) do
local text = row.nombre…" “…row.apellido …” "…row.dob
local t = display.newText(text, 20, 30 * row.id, null, 40)
t:setTextColor(255,0,255)
end
– Hide keyboard
native.setKeyboardFocus( nil )
end
botonShow:addEventListener(“tap”,AddSQL)
[import]uid: 123133 topic_id: 33347 reply_id: 333347[/import]