Android Question How to convert SQL statements in B4A?

bskotu555

Active Member
'cx' and 'zw' are text variables:
strSQL ="SELECT * FROM smt where cxnm='" & cx & "' and zwnm='" & zw & "'"
Cursor = Starter.Mysql_Jdbc.ExecQuery(strSQL)
 
Did you use backticks or single quotes? They're not the same character!
搜狗高速浏览器截图20241027190346.png

I put these two sentences into the program, but it just reported an error. What's the situation?
 
Upvote 0
If your column names are English word without blank spaces, then you don't need to escape them with back ticks.
You are of course absolutely right. I make it a habit of using backticks for column and table names: then, I don't have to worry about them being reserved words or containing special characters.
 
Upvote 0
Back
Top