TheEddy Posted August 3, 2010 Share Posted August 3, 2010 $sql = "SELECT * FROM `users` WHERE `emailAddress` = '".mysql_real_escape_string($_POST['email'])."' AND `password` = '".mysql_real_escape_string(md5($_POST['password']))."'"; I currently have it accepting just the email address but I want it to be the email address OR the username. How do I do this? Link to comment https://forums.phpfreaks.com/topic/209714-creating-a-log-in-script-accept-username-or-email/ Share on other sites More sharing options...
OrangeTux Posted August 3, 2010 Share Posted August 3, 2010 Use brackets, like Where ('emailadres' = '"blabla"' OR 'username' = '"blabla'") AND 'password' = '"blabla"'; Link to comment https://forums.phpfreaks.com/topic/209714-creating-a-log-in-script-accept-username-or-email/#findComment-1094776 Share on other sites More sharing options...
TheEddy Posted August 3, 2010 Author Share Posted August 3, 2010 Use brackets, like Where ('emailadres' = '"blabla"' OR 'username' = '"blabla'") AND 'password' = '"blabla"'; Thanks Link to comment https://forums.phpfreaks.com/topic/209714-creating-a-log-in-script-accept-username-or-email/#findComment-1094788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.