issue textfield and sqlite3

hi…

I’m new of sqlite3 and i’m trying to call data through a textfield.

When i insert a number value it works but when i try to search a text value it has an error:

No such column: mario File: no such column stack traceback: [C]: in function 'nrows' scene.lua:48: in function 'loadData' scene.lua:63: in function 'stampaConsolle' scene.lua:83: in function \<scene.lua:78\> ?: in function \<?:205\>

Where is my error? I allegate my code:

local widget = require ("widget") local sqlite = require "sqlite3" local function setUpDatabase(dbName) local path = system.pathForFile( dbName, system.DocumentsDirectory ) local file = io.open( path, "r" ) if ( file == nil ) then local pathSource = system.pathForFile( dbName, system.ResourceDirectory ) local fileSource = io.open( pathSource, "rb" ) local contentsSource = fileSource:read( "\*a" ) local pathDest = system.pathForFile( dbName, system.DocumentsDirectory ) local fileDest = io.open( pathDest, "wb" ) fileDest:write( contentsSource ) io.close( fileSource ) io.close( fileDest ) end local DB = system.pathForFile(dbName, system.DocumentsDirectory) local dbNew = sqlite3.open( DB ) return dbNew end db = setUpDatabase("data.db") function loadData() local sql = "SELECT \* from Vendite where Codice = " .. defaultField.text local al = {} for a in db:nrows(sql) do al[#al+1] = { Cod = a.Codice, Anno = a.Anno, } end return al end function stampaConsolle() local data = loadData() for x = 1, #data do text = display.newText (data[x].Cod,display.contentCenterX,display.contentCenterY,native.systemFontBold,15) text2 = display.newText (data[x].Anno,display.contentCenterX,display.contentCenterY + 20,native.systemFontBold,15) end end local defaultField local function textListener( event ) if ( event.phase == "ended" or event.phase == "submitted" ) then stampaConsolle(defaultField) end end -- Create text field defaultField = native.newTextField( 150, 150, 180, 30 ) defaultField:addEventListener( "userInput", textListener )

thanks for your help.