I have two tables from PhpMyadmin: Users table , History table. I want to insert 3 values into history table but according to user logged-in. The username and password must be selected from the users table. Can you please help me structure the sql command.
B4A CODE:
Dim cmd As DBCommand = CreateCommand("save", Array As String(Remytxt.Text, Hennytxt.Text, Sodatxt.Text,Starter.Username,Starter.Password))
MSQL Command from B4J config file:
sql.save =INSERT INTO history(Remy, Henny, Soda) VALUES (?, ?, ?)
SELECT * FROM users WHERE Username = ? AND Password = ?
Not sure that it is not worth splitting it into two commands. It will be simple to implement and will allow you to show a meaningful error message if the username and password are wrong.
Not sure that it is not worth splitting it into two commands. It will be simple to implement and will allow you to show a meaningful error message if the username and password are wrong.
Thanks for the response. I am not really good at creating SQL commands. If I create these commands separately, the insert and select command, How will I integrate/join them to do what I'm trying to achieve.
. I am not really good at creating SQL commands. If I create these commands separately, the insert and select command, How will I integrate/join them to do what I'm trying to achieve.