title: how to use md5() function with my sql database
body: <p>my problem is solved. I don't expect for more answers. So, please don't vote down, cause I need some reputations to vote up for others post. Thanks</p>
  
  <p>I try to use <code>md5()</code> for the login system but it doesn't encrypt password. It still display the original password on my database. Here is my code:</p>
  
  <pre><code>mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
  mysql_select_db("$db_name")or die("cannot select DB");
  
  $myusername=$_POST['myusername']; 
  $mypassword=md5($_POST['mypassword']); 
  
  
  
  $sql="select * from $tbl_name where username='$myusername' and password='$mypassword'";
  $result=mysql_query($sql);
  
  $count=mysql_num_rows($result);
  
  if($count==1){
  session_register("myusername");
  session_register("mypassword"); 
  header("location:login_success.php");
  }
  else {
  header("location:login.html");
  }
  ?&gt;
  </code></pre>
  
  <p>I just edit my code to <code>$mypassword=md5($_POST['mypassword']);</code> </p>