会员注册的时候密码md5加密存到数据库了,现在会员登录要md5密码之后去数据库查询应该怎么写?我获取表单md5后去数据库查询为什么不一样了,我的代码是
class AdminAction extends Action{
       function index(){
  if(isset($_POST['username'])){
        if(isset($_POST['username'])&&isset($_POST['password'])){
    $secure_code = C('SECURE_CODE');
    $userpassword=md5($secure_code.md5($_POST["password"]));
    $db=M();
$select=$db->query("select * from developers where username=".$_POST['username']." and password=".$userpassword."");
 echo $db->getLastSql();exit;应该怎么写呢?