SQLite problem

Anyone know why this statement does not work?

local tablefill = “INSERT INTO Names2 VALUES (16,fname,‘Jones’)”
db:exec( tablefill )

fname is a variable containing the name “John” but this statement does not work. If I change it to this:

local tablefill = “INSERT INTO Names2 VALUES (16,‘John’,‘Jones’)”
db:exec( tablefill )

it works. Should variables not be able to be used as VALUES?

thanks. [import]uid: 23600 topic_id: 8125 reply_id: 308125[/import]

dude, literally yesterday we were explaining this to you:
http://developer.anscamobile.com/forum/2011/03/19/lua-and-sqlite

In that thread you said you’ve been programming for years, but you seem to be confused about how to put the value of a variable into a string. Basically, the string “fname” is not the same as the variable fname. It’s just like how the string “1” is not the same as the integer 1. You don’t literally want the letters “fname” in your SQL command, you want the value of the variable fname; that’s what string concatenation is for. [import]uid: 12108 topic_id: 8125 reply_id: 28946[/import]