06.01.2014, 10:34
The better option would be to select all the data once and assign them if there are rows. In the login, you already got the password so compare it and you're done.
Few notes:
- Reset variables on connect.
- Instead of cache_get_data and storing the rows and fields to 2 variables, you could use directly cache_num_rows function:
Also keep in mind about race condition attacks with threaded queries.
Using the field's index instead of the name is faster, but yes - it depends on the user!
Few notes:
- Reset variables on connect.
- Instead of cache_get_data and storing the rows and fields to 2 variables, you could use directly cache_num_rows function:
pawn Code:
if (cache_num_rows()) // if (rows)
Using the field's index instead of the name is faster, but yes - it depends on the user!