Mysql_fetch_row doesn't work.



  • <?php
    ini_set("display_errors","1");
    ini_set("display_startup_errors","1");
    ini_set('error_reporting', E_ALL);
    function engine_crypt ($password) {
        $salt=strlen($password).crc32($password);
        $sha1=sha1($salt.$password);
        $result=md5($sha1.$salt);
        return $result;
    }
    
    function engine_var ($var) {
        $var = stripslashes($var);
        $newvar = str_replace("\n","",$var);
        $newvar = str_replace(";","&#59;",$newvar);
        $newvar = str_replace("%","&#37;",$newvar);
        $newvar = str_replace("'","&#39;",$newvar);
        $newvar = str_replace(",","&#44;",$newvar);
        $newvar = str_replace(".","&#46;",$newvar);
        $newvar = str_replace(":","&#58;",$newvar);
        $newvar = str_replace("`","&#96;",$newvar);
        return $newvar;
    }
    include 'includes/config.php';
    $query="SELECT `id`,`nickname`,`status` FROM `users` WHERE `nickname`='".'buffon'."' and `password`='".engine_crypt('zblhepmz')."'";
    $query_result = mysql_query($query);
    $row = mysql_fetch_row($query_result) or die('DIED: '.mysql_error());
    ?>
    

    query demand is correct 100% (in mysql, and it's normal for everyone to return)

    (include 'includes/config.php'; connection to the base)

    Is it a die without any error, mysql_error() empty, what's the salt?



  • Actually, we need to do mysql_query or die('DIED: '.mysql_error());

    The error may be caused by the fact that the sample is empty. That's what's going on.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2