SELECT name FROM users WHERE something AND something

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

please for your help.
I have in my code this:

B4X:
SQL1.ExecQuerySingleResult("SELECT name FROM users where value =" & getvalue & "and usernr ="& getnr)

The trouble is with & "and usernr ="& getnr

I get error = SQLiteException:unrecognized token
How can I solve this multiple order to SQL, where I have mistake in code, please?

Thank you very much and have a nice day
p4ppc
 

petr4ppc

Well-Known Member
Licensed User
Longtime User
EREL AND
THEDESOLATESOUL

Very, very thank you:

Your code Erel:
B4X:
SQL1.ExecQuerySingleResult2("SELECT name FROM users where value =  ? and usernr = ?", Array As String(getvalue, getnr))

is very good. Everything is OK.

I know, that I have read about this in your tutorial, where this multiple system is use for INSERT function in SQL.

Now I know, that it is useful for SELECT function

here is EREL´s SQL tutorial
http://www.b4x.com/forum/basic4android-getting-started-tutorials/6736-sql-tutorial.html#post39108

Thank you very much
Have a good day
p4ppc
:sign0142:
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…