Hi Guys
I have made a registration form to register on my website. In the SQL I have a AUTONUMBER field called userID
My code does register as per normal but the AUTONUMBER field is provided by the MySQL so the code does not know what this user
ID is. I want to immediately query the database to get this userID and store it locally with all the other user info.
I have tried a few options but it seems like I just do not have the format to do it. I managed to get all the userIDs of all the registered users (first box below)and I can filter that but it seems like a long way round.
The best way would for me to send a query to the database with the Loginname and request back the userID then save it in the local database.
Comes up with this error. I user PeterLewis10 as dtaUsername
Thank you in advance
Peter
I have made a registration form to register on my website. In the SQL I have a AUTONUMBER field called userID
My code does register as per normal but the AUTONUMBER field is provided by the MySQL so the code does not know what this user
ID is. I want to immediately query the database to get this userID and store it locally with all the other user info.
I have tried a few options but it seems like I just do not have the format to do it. I managed to get all the userIDs of all the registered users (first box below)and I can filter that but it seems like a long way round.
Brings back all the userIDs of all the registered users:
Dim Cursor As ResultSet
Cursor = Sql2.ExecQuery("SELECT userID FROM User_db")
Do While Cursor.NextRow
Log(Cursor.GetString("userID"))
Loop
The best way would for me to send a query to the database with the Loginname and request back the userID then save it in the local database.
trying to filter out only 1 result dependant on the LoginName:
Log(dtaUsername.Text)
Dim Cursor As ResultSet
Cursor = Sql2.ExecQuery("SELECT userID FROM User_db WHERE LoginName = "&(dtaUsername.Text))
Do While Cursor.NextRow
Log(Cursor.GetString("userID"))
Loop
Comes up with this error. I user PeterLewis10 as dtaUsername
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'PeterLewis10' in 'where clause'
Thank you in advance
Peter
Last edited: