Having a hard time saving data from a native text field to sqlite database in corona.
here are some relevant code:
[code]function printrecord()
for row in db:nrows(“SELECT * FROM test”) do
t = display.newText(row.pname … " " … row.age … " " … row.desc, 20, 30 * row.id, null, 16)
t:setTextColor(255,255,255)
end
end
newData = native.newTextField ( 20, _H - 90, 280, 30 )
newData.inputType = “text”
saveData = function ( event )
textString = newData.text
db:exec( [[INSERT INTO test VALUES (NULL, textString, 30, “unknown”)]] )
t:removeSelf()
t = nil
printrecord()
end
savebutton = widget.newButton {
default = “buttonGreen.png”,
over = “buttonGreenOver.png”,
label = “Save”,
embose = true,
onRelease = saveData
} [/code]
when I try to change the textString from db:exec( [[INSERT INTO test VALUES (NULL, textString, 30, "unknown")]] )
to a string like “this is a string” it seems to work fine, can anyone help? [import]uid: 189861 topic_id: 33226 reply_id: 333226[/import]