bskotu555 Active Member Oct 25, 2024 #1 'cx' and 'zw' are text variables: strSQL ="SELECT * FROM smt where cxnm='" & cx & "' and zwnm='" & zw & "'" Cursor = Starter.Mysql_Jdbc.ExecQuery(strSQL)
'cx' and 'zw' are text variables: strSQL ="SELECT * FROM smt where cxnm='" & cx & "' and zwnm='" & zw & "'" Cursor = Starter.Mysql_Jdbc.ExecQuery(strSQL)
W walt61 Well-Known Member Licensed User Longtime User Oct 26, 2024 #2 Similar to https://www.b4x.com/android/forum/t...ified-conditions-a-and-b.163731/#post-1004256 : Code: Copy strSQL ="SELECT * FROM smt where `cxnm`=? and `zwnm`=?" Cursor = Starter.Mysql_Jdbc.ExecQuery2(strSQL, Array As String(cx, zw)) Upvote 0
Similar to https://www.b4x.com/android/forum/t...ified-conditions-a-and-b.163731/#post-1004256 : Code: Copy strSQL ="SELECT * FROM smt where `cxnm`=? and `zwnm`=?" Cursor = Starter.Mysql_Jdbc.ExecQuery2(strSQL, Array As String(cx, zw))
bskotu555 Active Member Oct 26, 2024 #3 walt61 said: Similar to https://www.b4x.com/android/forum/t...ified-conditions-a-and-b.163731/#post-1004256 : Code: Copy strSQL ="SELECT * FROM smt where `cxnm`=? and `zwnm`=?" Cursor = Starter.Mysql_Jdbc.ExecQuery2(strSQL, Array As String(cx, zw)) Click to expand... The statement is incorrect here. The symbols' and ',' and 'should be placed next to each other Upvote 0
walt61 said: Similar to https://www.b4x.com/android/forum/t...ified-conditions-a-and-b.163731/#post-1004256 : Code: Copy strSQL ="SELECT * FROM smt where `cxnm`=? and `zwnm`=?" Cursor = Starter.Mysql_Jdbc.ExecQuery2(strSQL, Array As String(cx, zw)) Click to expand... The statement is incorrect here. The symbols' and ',' and 'should be placed next to each other
W walt61 Well-Known Member Licensed User Longtime User Oct 27, 2024 #4 Did you use backticks or single quotes? They're not the same character! Upvote 0
bskotu555 Active Member Oct 27, 2024 #5 walt61 said: Did you use backticks or single quotes? They're not the same character! Click to expand... I put these two sentences into the program, but it just reported an error. What's the situation? Upvote 0
walt61 said: Did you use backticks or single quotes? They're not the same character! Click to expand... I put these two sentences into the program, but it just reported an error. What's the situation?
aeric Expert Licensed User Longtime User Oct 27, 2024 #6 bskotu555 said: View attachment 158030 I put these two sentences into the program, but it just reported an error. What's the situation? Click to expand... If your column names are English word without blank spaces, then you don't need to escape them with back ticks. Just write like this will do: B4X: Copy Dim strSQL As String = "SELECT * FROM smt WHERE cxnm = ? AND zwnm = ?" Upvote 0
bskotu555 said: View attachment 158030 I put these two sentences into the program, but it just reported an error. What's the situation? Click to expand... If your column names are English word without blank spaces, then you don't need to escape them with back ticks. Just write like this will do: B4X: Copy Dim strSQL As String = "SELECT * FROM smt WHERE cxnm = ? AND zwnm = ?"
W walt61 Well-Known Member Licensed User Longtime User Oct 27, 2024 #7 aeric said: If your column names are English word without blank spaces, then you don't need to escape them with back ticks. Click to expand... 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
aeric said: If your column names are English word without blank spaces, then you don't need to escape them with back ticks. Click to expand... 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.
W walt61 Well-Known Member Licensed User Longtime User Oct 27, 2024 #8 bskotu555 said: View attachment 158030 I put these two sentences into the program, but it just reported an error. What's the situation? Click to expand... You have a NullPointerException. Possibly, your Mysql_Jdbc has not been initialised. Upvote 0
bskotu555 said: View attachment 158030 I put these two sentences into the program, but it just reported an error. What's the situation? Click to expand... You have a NullPointerException. Possibly, your Mysql_Jdbc has not been initialised.
bskotu555 Active Member Oct 28, 2024 #9 I made a low-level mistake: the SMT database does not exist, I replaced it with a program, and after making the necessary changes, it will be fine. walt61 said: You have a NullPointerException. Possibly, your Mysql_Jdbc has not been initialised. Click to expand... Upvote 0
I made a low-level mistake: the SMT database does not exist, I replaced it with a program, and after making the necessary changes, it will be fine. walt61 said: You have a NullPointerException. Possibly, your Mysql_Jdbc has not been initialised. Click to expand...