refiking Posted February 12, 2008 Share Posted February 12, 2008 Trying to retrieve password from DB and am completely lost. What do I need to change this to? include 'cont.php'; $pass = md5($_POST['password']); $sql = mysql_query("SELECT passwd FROM ost_staff WHERE username = '$username ' AND passwd='$pass'"); Quote Link to comment https://forums.phpfreaks.com/topic/90796-md5-help/ Share on other sites More sharing options...
schilly Posted February 12, 2008 Share Posted February 12, 2008 looks fine as long as the password in the db is md5 hashed as well. Quote Link to comment https://forums.phpfreaks.com/topic/90796-md5-help/#findComment-465402 Share on other sites More sharing options...
cooldude832 Posted February 13, 2008 Share Posted February 13, 2008 You do realize you are returning the md5 hash with that logic? All queries posted on here must be written in the structure <?php $q = "SELECT passwd FROM `ost_staff `WHERE username = '".$username."' AND passwd='".$pass."'"; $r = mysql_query($q) OR DIE(MYSQL_ERROR()."<br/><br />".$q); ?> That or die part will probably error in your case and then you will realize its a sql problem not php. However I do not see you doing anything with that query so even if it doesn't error you just assigned a mysql resource, didn't do anything on it. Quote Link to comment https://forums.phpfreaks.com/topic/90796-md5-help/#findComment-465441 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.