SQL Newbie question:
When implementing lesson 3 database search on (Win I get errors:
1)SQLite: search string is "go" with sample database
Code is:
put "SELECT firstname,lastname,contact_id FROM contacts" into tSQLQuery
put "WHERE firstname LIKE '%" & tSearchText & "%' OR lastname LIKE '%" & tSearchText & "%'" after tSQLQuery
ERROR is:"revdberr,Database Error: near "LIKE": syntax error"
2)My SQL: search string is "go" with sample database
Code is same as above
ERROR is: revdberr,You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIKE '%go%' OR lastname LIKE '%go%'' at line 1
3) Search with the Web MySQL code works fine.
Code:
put url ("http://techsupport.on-rev.com/cloudtest ... lc?search=" & tSearchText) into tContacts
Any help is appreciated.
Jack
Lesson 3 SQL Search problem
Moderators: LCNeil, heatherlaine, kevinmiller, elanorb
Re: Lesson 3 SQL Search problem
Try putting the tSQLquery contents and see how it reads.
It seems to me that where you construct the query by appending the where clause, you haven't left a space between them so your query will have an unparsable word 'contactsWHERE' in the middle?
It seems to me that where you construct the query by appending the where clause, you haven't left a space between them so your query will have an unparsable word 'contactsWHERE' in the middle?
Re: Lesson 3 SQL Search problem
Thanks Sparkout, once again your keen eye saved my day. I am new to SQL and will have quite a learning curve...
Jack
Jack