Please, test the sql sentences in your phpmyadmin or your sql manager, when you see you get a proper response, then use it in B4J
For example, if you use "SELECT LAST_INSERT_ID()" you will see there's no column called 'userId"
View attachment 90981
Try with
SELECT LAST_INSERT_ID() AS 'userID' FROM User_db;
I mean
Log(dtaUsername.Text)
Dim Cursor As ResultSet
Cursor = Sql2.ExecQuery("SELECT LAST_INSERT_ID() AS 'userID' FROM User_db")
Do While Cursor.NextRow
Log(Cursor.GetString("userID"))
Loop
Sorry with my second sample, I put two ''. Try with (again, test in your database, and when you get your sql working, copy it to B4J
Cursor = Sql2.ExecQuery("SELECT userID FROM User_db WHERE LoginName = '"&(dtaUsername.Text) &"")
Test it before to see the result in your DBMS:
View attachment 90982