title: MySQL MD5 SELECT
body: <p>This following query returned null.</p>
  
  <pre><code>SELECT `email`, `password`, `salt` FROM `users` WHERE `password` = md5(`salt`+md5('123123'+`salt`)+'123123') AND `email` = 'xeka@xeka.ru'
  </code></pre>
  
  <p>The following query returned 'd2b4312db21705dafd96df14f8525fef', but why?</p>
  
  <pre><code>SELECT md5( 'Vwm' + md5( '123123' + 'Vwm' ) + '123123' )  
  </code></pre>
  
  <p>This code returned '422ad0c19a38ea88f4db5e1fecaaa920'.</p>
  
  <pre><code>$salt = 'Vwm';
  $password = '123123';
  
  echo md5($salt . md5($password . $salt) . $password);
  </code></pre>
  
  <p>Do user authorization. How do I create a query to the database so that the first took SALT and SALT have this I did some MD5 function?</p>