I'm making a sign up page and I need to insert the values on the database:
code:
<?php
    include 'config.php';
    $nome = $_POST['nome'];
    $sobrenome = $_POST['sobrenome'];
    $email = $_POST['email'];
    $ocupacao = $_POST['ocupacao'];
    $senha = $_POST['senha'];
    $senha2 = $_POST['senha2'];
    $emailkey = md5(microtime().rand());
    $ativo = 0; 
    $db = new PDO('mysql:host=localhost;dbname=sdpa;charset=utf8mb4', $user, $pass);
    $checemail = $db->prepare("SELECT * FROM  usuarios WHERE Email = :email");
    $checemail->bindParam(':email', $email, PDO::PARAM_STR);
    $checemail->execute();
    if ($checemail->rowCount() > 0) {
        //email already cadastred
    } else {
        $qr = $db->prepare("INSERT INTO usuarios(Nome, Sobrenome, Email, Ocupacao, Senha, EmailKey, Ativo) VALUES(?, ?, ?, ?, ?, ?, ?)");
        $qr->bindParam(1, $nome, PDO::PARAM_STR);
        $qr->bindParam(2, $sobrenome, PDO::PARAM_STR);
        $qr->bindParam(3, $email, PDO::PARAM_STR);
        $qr->bindParam(4, $ocupacao, PDO::PARAM_STR);
        $qr->bindParam(5, $senha, PDO::PARAM_STR);
        $qr->bindParam(6, $emailkey, PDO::PARAM_STR);
        $qr->bindParam(7, $ativo, PDO::PARAM_STR);
        $qr->execute();
        mail($email, "Chave de Ativacao", "Olá, obrigado por se registrar no SDPA, para ativar a sua conta, entre no link \n http://localhost/register_final?key=" + $emailkey + "", "Chave De Aticavao");
        echo "" + $emailkey;
    }
    $db = null;
?>
But, in the DB, the php inserts this:
aea3001cbe1aae38e0768b4d2d304c67
And, in the echo and the email, it shows this:
0
 
    