用spring生成的盐渍md5密码不同于php生成的salt md5密码

I am using username as a salt for spring security however when I tried to do the similar case in php it generates a different hashed password. The following is my php code:

<?php
   $un=$_POST['username'];  
   $pw=$_POST['password']; 
   $salt ='weiren';
   $passw='enjoyit';
   $pass=md5($passw.md5($salt));
   mysql_connect("localhost","root","");
   mysql_select_db("dbname");
   $sql=mysql_query("select * from people where username = '$un' and password = '$pw'");

   if(mysql_num_rows($sql) > 0)  
      // ( $un == “ajay” && $pw == “ajay”)  
      echo 1;  // for correct login response  
   else  
      echo $pass;
   // for incorrect login response  
?>