Basic Login Script using php and mysql inquiry
Posted
by Matt
on Stack Overflow
See other posts from Stack Overflow
or by Matt
Published on 2010-05-25T21:46:45Z
Indexed on
2010/05/25
21:51 UTC
Read the original article
Hit count: 298
Attempting to write a check for a login script to see if the username is available.
Would the best way to write this query be to check
if isset(!_POST[]) for both values (nick and pass)
then connect to database
WHERE the mysql database for the usernick requested
return the user id if the usernick exists
evaluate if isset($id) to see if the user name is taken
and use that to continue to creating an entry
Does this logically sound like a method to check for login without using excessive code
sorry for not posting the code, it is on another computer and this computer is locked down by my administrator at work...
Also, is there another way to evaluate if a value exists in the database?
For instance, instead of setting $id to the return value of the mysql database can i just ping the mysql database for the information and have it return a Boolean result so I am not putting out any user information.
Thanks, Matt
© Stack Overflow or respective owner