title: Secure password is now only allowing the encrypted password
body: <p>so I created this login in form using HTML and PHP. I used md5 encryption to encrypt the password on the database. Now when a user tries to login the database is only accepting the encrypted password. What is the best course for this?</p>
  <pre><code>$user_name = $_POST['user_name'];
      $password = md5($_POST['password']);
  
      if(!empty($user_name) &amp;&amp; !empty($password) &amp;&amp; !is_numeric($user_name))
      {
  
          //save to database
          $user_id = random_num(20);
          $query = &quot;insert into users (user_id,user_name,password) values ('$user_id','$user_name','$password')&quot;;
  </code></pre>
  <p>What is the best course of action to use here.</p>