faustf Posted June 15, 2015 Share Posted June 15, 2015 hi guy i try to insert in db sqlite some data , but when arrive at mail giveme always error expandcollapse popupSQLITE_APERTURA() ; con questa funzione facciopartire sql e apro il db robo_annunci nella script dir ;MsgBox (0,'',$mail) If Not _SQLite_Exec(-1, "INSERT INTO annunci (" & _ "categoria," & _ "sottocategoria," & _ "offro_cerco," & _ "titolo," & _ "prezzo," & _ "descrizione," & _ "path_immagini) " & _ "email) " & _ "nome) " & _ "telefono) " & _ "velocita_macro) " & _ "paypal_sino) " & _ "subito_it) " & _ "kijiji_it) " & _ "secondamano_it) " & _ "bakeca_it) " & _ "comune) " & _ "password) " & _ "indirizzo) " & _ "VALUES (" & _ _SQLite_FastEscape($categoria) & "," & _ _SQLite_FastEscape($sottocategoria) & "," & _ _SQLite_FastEscape($offro_cerco) & "," & _ _SQLite_FastEscape($Titolo) & "," & _ _SQLite_FastEscape($PREZZO_letto) & "," & _ _SQLite_FastEscape($descrizione_letto) & "," & _ _SQLite_FastEscape($percorso_foto) & "," & _ _SQLite_FastEscape($mail) & "," & _ _SQLite_FastEscape($numero_hide) & "," & _ _SQLite_FastEscape($slide_ritardo) & "," & _ _SQLite_FastEscape($paypal_si_no) & "," & _ _SQLite_FastEscape($status_subito_it) & "," & _ _SQLite_FastEscape($status_Kijiji_it) & "," & _ _SQLite_FastEscape($status_secondamano_it) & "," & _ _SQLite_FastEscape($status_Bakeca_it) & "," & _ _SQLite_FastEscape($aItem[7]) & "," & _ ;password _SQLite_FastEscape($aItem[8]) & _ ;indirizzo ");") = $SQLITE_OK Then _ MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) SQLITE_CHIUSURA() ; con questa funzione chiudo il database e shutdown lsqlitei try to use mail@gmail.com and mail without @gmail.com but give me the same error_SQLite_LibVersion=3.8.4.3! SQLite.au3 Error--> Function: _SQLite_Exec--> Query: INSERT INTO annunci (categoria,sottocategoria,offro_cerco,titolo,prezzo,descrizione,path_immagini) email) nome) telefono) velocita_macro) paypal_sino) subito_it) kijiji_it) secondamano_it) bakeca_it) comune) password) indirizzo) VALUES ('Biglietti','Musica','offro','Input1','100','Edit1','C:\Users\e-Office\Pictures\Nikon Transfer\004','eoffice','3356963030','2000','stfn77@gmail.com','','','','','via della parte 19','stfn77@gmail.com');--> Error: near "email": syntax errorthis is my table in sql dbCREATE TABLE [annunci] ( [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, [categoria] VARCHAR(300) NULL, [sottocategoria] VARCHAR(300) NULL, [offro_cerco] VARCHAR(300) NULL, [titolo] VARCHAR(300) NULL, [prezzo] VARCHAR(300) NULL, [descrizione] VARCHAR(300) NULL, [path_immagini] VARCHAR(300) NULL, [email] VARCHAR(300) NULL, [nome] VARCHAR(300) NULL, [telefono] VARCHAR(300) NULL, [velocita_macro] VARCHAR(300) NULL, [paypal_sino] VARCHAR(300) NULL, [subito_it] VARCHAR(300) NULL, [kijiji_it] VARCHAR(300) NULL, [secondamano_it] VARCHAR(300) NULL, [bakeca_it] VARCHAR(300) NULL, [comune] VARCHAR(300) NULL, [password] VARCHAR(300) NULL, [indirizzo] VARCHAR(300) NULL )thankz at all for help Link to comment Share on other sites More sharing options...
jchd Posted June 15, 2015 Share Posted June 15, 2015 (edited) You have extra closing parenthesis after several column names and missing commas separating them.expandcollapse popupSQLITE_APERTURA() ; con questa funzione facciopartire sql e apro il db robo_annunci nella script dir ;MsgBox (0,'',$mail) If Not _SQLite_Exec(-1, "INSERT INTO annunci (" & _ "categoria," & _ "sottocategoria," & _ "offro_cerco," & _ "titolo," & _ "prezzo," & _ "descrizione," & _ "path_immagini, " & _ "email, " & _ "nome, " & _ "telefono, " & _ "velocita_macro, " & _ "paypal_sino, " & _ "subito_it, " & _ "kijiji_it, " & _ "secondamano_it, " & _ "bakeca_it, " & _ "comune, " & _ "password, " & _ "indirizzo) " & _ "VALUES (" & _ _SQLite_FastEscape($categoria) & "," & _ _SQLite_FastEscape($sottocategoria) & "," & _ _SQLite_FastEscape($offro_cerco) & "," & _ _SQLite_FastEscape($Titolo) & "," & _ _SQLite_FastEscape($PREZZO_letto) & "," & _ _SQLite_FastEscape($descrizione_letto) & "," & _ _SQLite_FastEscape($percorso_foto) & "," & _ _SQLite_FastEscape($mail) & "," & _ _SQLite_FastEscape($numero_hide) & "," & _ _SQLite_FastEscape($slide_ritardo) & "," & _ _SQLite_FastEscape($paypal_si_no) & "," & _ _SQLite_FastEscape($status_subito_it) & "," & _ _SQLite_FastEscape($status_Kijiji_it) & "," & _ _SQLite_FastEscape($status_secondamano_it) & "," & _ _SQLite_FastEscape($status_Bakeca_it) & "," & _ _SQLite_FastEscape($aItem[7]) & "," & _ ;password _SQLite_FastEscape($aItem[8]) & _ ;indirizzo ");") = $SQLITE_OK Then _ MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) SQLITE_CHIUSURA() ; con questa funzione chiudo il database e shutdown lsqliteFYI, schema names including spaces need to be enclosed in either double quotes "my table", or square brackets [my beautiful table] or backquotes `my last attempt to a smart table`. Edited June 15, 2015 by jchd faustf 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
faustf Posted June 16, 2015 Author Share Posted June 16, 2015 thankkzzzz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now