查询不插入,但也没有给出错误

I got this query and it's not inserting into the database but it's not giving an error either.

        try {
        $sth = $Db->dbh->prepare("INSERT INTO users (username,password,email,phone,first_name) VALUES (:username,:password,:email,:phone,:firstname)");
        $sth->execute(array(':username' => $username,':password' => $password, ':email' => $email,':phone' => $phone,':firstname'=>$firstname));
    } catch(Exception $e) {
        echo $e->getMessage();
        exit();
    }

enter image description here I've tried inserting the query by command and it works fine. There are other insert queries on the site and those work fine too.. I'm not sure what I'm doing wrong here

Can you try something like this?

try
{
    // Prepare Statement
    if (!($stmt = $mysqli->prepare("INSERT INTO users (username,password,email,phone,first_name) VALUES (?,?,?,?,?)")))
        throw new Exception("Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error);

    // Bind Parms
    if (!$stmt->bind_param("sssss", $username, $password, $email, $phone, $firstname))
        throw new Exception("Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error);

    // Execute Statement
    if (!$stmt->execute())
        throw new Exception("Execute failed: (" . $stmt->errno . ") " . $stmt->error);
}
catch (Exception $ex) {
    exit('Error: '. $ex->getMessage());
}

P.S. As TiiJ7 suggestion on the comment to your question, are those two columns perm and rank - are they nullable columns? if not, you might have to specify a value at the time of row insertion.

More info here: http://php.net/manual/en/mysqli.quickstart.prepared-statements.php