Hello folks,
I've got an MTA server set up along with a MySQL server. The database contains a table named Account, where the user data is stored (e.g. Username, Password...).
Next, my login requests the user to enter his username and his password. Then it tries to fetch the correct password of the respective username from the database in order to compare it with the password that has been entered. Unfortunately, although the database connection is established, the query always returns nil:
(In the code snippet below, this is line 11.)
I would really like to do more research on this matter myself since it's kind of a basic problem; but I was unable to find much documentation or even better a tutorial on the mysql "add-in". Any suggestions on the problem or documentation references would be greatly appreciated
function evaluateLogin(enteredUsername, enteredPassword)
outputChatBox("Login auswerten: " .. enteredUsername .. "//" .. enteredPassword)
handler = mysql_connect("localhost", "[color=#FF8000]<myUser>[/color]", "[color=#FF8000]<myPwd>[/color]", "mta")
sqlresult = mysql_query(handler, "SELECT Password from Account WHERE Username=" .. enteredUsername)
if sqlresult then
mysql_free_result(sqlresult)
end
result = mysql_fetch_field(sqlresult)
outputChatBox(result[0])
end