title: How to fetch md5 password from database php?
body: <p>How to fetch md5 password from database.
  i am making a login form>
  i want,when the user is going to login.if the username and password text field is matched with database than use will login.</p>
  
  <p>database..
  in database,i store the password with md5().
  now how to fetch the password from database.and how to make validation with this.
  thanks all</p>
  
  <pre><code>&lt;h1&gt;Login Here&lt;/h1&gt;
  &lt;form name="f1" action="login.php" method="post"&gt;
  &lt;table border="1"&gt;
  &lt;tr&gt;&lt;td&gt;username&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="t1"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;password&lt;/td&gt;&lt;td&gt;&lt;input type="password" name="t2"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;input type="submit" value="login"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>login.php  </p>
  
  <pre><code>  &lt;?php
      include "db.php";
      $user=$_POST['t1'];
      $pass=$_POST['t2'];
      $result=mysql_query("select * from core where username='$user'")or die(mysql_error());
      $row=mysql_fetch_row($result);
      ?&gt;
      &lt;h1&gt;Welcome Mr. &lt;?php echo $user;?&gt;&lt;/h1&gt;
      &lt;table border="1"&gt;
      &lt;tr&gt;&lt;td&gt;Your User-Id :- &lt;/td&gt;&lt;td&gt;&lt;?php echo $row[0];?&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Your Username: &lt;/td&gt;&lt;td&gt;&lt;?php echo $row[1];?&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;your md5 Password: &lt;/td&gt;&lt;td&gt;&lt;?php echo $row[2];?&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;your Email Id: &lt;/td&gt;&lt;td&gt;&lt;?php echo $row[3];?&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>