Im trying to learn MySQL with Delphi. Ive got it to connect to my database fine. Now Im trying to make it validate an entered username and password to the username and password on the database.
This code is for the login button action. It compiles, but when I click login, I get an error. How do I do this? Iim not sure what way to lay out the "enteredusername.Text", if it even needs .text etc. I think I need to use "pchar" somewhere, but arent sure where. Someone help!
Code:
mysql_query(@sqlconnection, 'SELECT * FROM staff WHERE staffid = enteredusername.Text AND password= enteredpassword.Text');
sqlresult := mysql_store_result(@sqlconnection);
sqlrow := mysql_fetch_row(sqlresult);
if sqlrow[1] = enteredpassword.Text
then //The rest of the code....