Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Users table structure is this: id|username|password|email
- id - auto_increment + primary_key
- username - unique index
- email - unique index
- $post_input = $_POST['user_input'] //will be username or email
- $check = $db->prepare("Select * from users where username=? or email=?")
- $check->execute(array($post_input,$post_input));
- if($check->rowCount() > 0){
- //Username or Email found from here do the rest of the things
- }
- $post_input = $_POST['user_input'] //will be username
- $check = $db->prepare("Select * from users where username=?")
- $check->execute(array($post_input));
- if($check->rowCount() > 0){
- //Username found from here do the rest of the things
- }
- Select * from users where username=? limit 0,1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement