In another PHP MySQL login tutorial I’ll teach you how to check if the users username exists already before it’s created. This will stop multiple users from having the same username. All PHP…
Original source
In another PHP MySQL login tutorial I’ll teach you how to check if the users username exists already before it’s created. This will stop multiple users from having the same username. All PHP…
Original source
40 responses to “PHP MySQL Login Tutorial – Check if Username Exists”
how can we hide the database password?
like in your tutorial u have declared '$password' as a parameter but its not initialized ….
where is the value for the password ?
Is there anyway that we can hide the password?
1) You don't hash your passwords,
2) You don't sanitize the users input,
3) You don't use prepared statements
Why?? This isn't quite save. Never save a password as plaintext in your database and don't trust the users input. A hacker can insert malicious code and do whatever he likes. It becomes a lot harder to insert malicious code if you use prepared statements.
Theres someone called RustyB in a game and i wanna be exactly called like that too but i dont now how. Please tell me how.
Salamat HAHAH! Nakatulong ka ng malaki
good job bro. Working !
simple, straight and forward thanks for the work!!
100% Perfectly Worked Bro !! 😀
Thank U Very Much Bro !! 😀
why would i check if its already in the database when i can just set the data unique (not primary) and run a if statement if the insert query is true do something else data already exist
Thanks alot. it worked smart and have been of help to me. God bless u
Thanks very much for this tut! it helped me solved a problem that disturbed me for more than 2 hours.
Thanks very much…have been looking for the soltion.
How do i check if user ID exist or not ? Need help please. So far I did this
public function isUserIDValid($user_id){
return filter_var($user_id, FILTER_VALIDATE_REGEXP);
but i'm getting "filter_var(): 'regexp' option missing" in and also invalid ID. How do I solve this problem ? TQ
NO WORKING
great dear you have very good method of explaining i love i like it so much
No one need to dislike your good video. You help a lot of people to learn many things. Thanks for delivering such material to us.
Can you help me this query("SELECT * FROM users WHERE username='$name' ");
returns zero rows,although there is that user in database.So i always get 0 rows but i should get atleast 1.
getting these ERRORS:
Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/a5322190/public_html/phpscripts/signup.php on line 85
Free Web Hosting
PHP Error Message
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/a5322190/public_html/phpscripts/signup.php on line 86
yeah this isnt working. its still creating an account with the same username
getting these errors:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'a1636810'@'localhost' (using password: NO) in /home/a1636810/public_html/signup.php on line 48
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/a1636810/public_html/signup.php on line 48
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a1636810/public_html/signup.php on line 49
I keep getting the duplicate entry method and it doesn't get to the check rows part, what should I do? please help lol. Duplicate entry 'rudolph' for key 'username'
There is no minimum or maximum password or username requirement. This allows a user to "signup" with nothing in the username and password boxes, which will then allow a user to "login" with nothing in the username and password boxes.
thanks!
Thanks. Was looking for something like the mysql_num_rows. 🙂
hey man you are going good. but what about the database after inserting the same name which is "admin". i wanted to show your database at that time.
Clean code. Nice. nothing extra.
Thank you for this! Easily explained and simple…
Thank you
excuse me, if i want verify for password, what should i code for this video?
Do NOT use any of the things this tutorial is giving you. He is providing concatenated data which is prone to SQL injections. Use PDO and not the deprecate mysql functions. With PDO, you have prepared statements which protect against SQL Injections.
Nice one, we need more people like you. Thank you
people, i have always been wondering why technology cannot design dream video recorder.
a camera that can record dreams.
can they?
please share to others
It helped me lot. Thank you.
Thank you for the helpful video!
thanks for sharing ur code really helped me a lot….:)
Thank you! Great video.
Thanks a bunch for this. I'm having some trouble though. On my website can simply enter anything you'd like into the login field and it will 'log you in.' How would I heck to see if the login, password and email match an entry in the database and deny the user access if they don't have an account? Maybe you already covered that and I just missed it.
BROTHER U JUST SAVED MY LIFE , thank you very much, i watched most of urs tutorials and i have learned php and mysql like never before !
mate thank you very very very very very very very very very very very very very very very very very very very very much… 😀
you save me 4 exams….. 😀
what? no sha1?
hey i cant seem to get you pm so im here just tell me when your ready