![]() |
SQL Problem
I am probably doing this horribly wrong, but I am really new to SQL and would appreciate ANY advice given.
Basically my aim is to make a login box. I have made it, it works. BUT It only allows you to login to the LAST created Account and Password Row, it seems all others are ignored. Here is the GUI I am using to login. PHP Code:
PHP Code:
|
because you're constantly cycling through all rows.
your query should be something like SELECT * FROM Accounts WHERE Account='"@params[1]@"'"; then if your returned rows array size is greater than one, you know the account exists. then, if the password is correct, then it is valid. However, this sort of password authentication on a server is usually pretty pointless since you should inherently trust the login of the player itself from Graal. If it's to try to add an extra layer of security to staff tools, you can simply verify some additional right like player.hasrightflag("warptoxy") and that will verify that the staff member is logging in from a valid location as determined by their listed IP/PC ranges |
Since I posted this i have been Googling away madly and have found out a little bit more :D so WHERE Account= would select the row that contains the account entered?
And I am mainly doing this as practise with SQL i plan to make a WHOLE system using it like Guns with ammo stored in SQL and pretty much everything. Thanks for your help :) |
| All times are GMT +2. The time now is 03:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.