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'"); 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. 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. Link to comment https://forums.phpfreaks.com/topic/90796-md5-help/#findComment-465441 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.