-1

私はすべてが大丈夫だと思います。メールはDBに保存されますが、出力は0です。どこが間違っていますか?

class connection {
    private $mail;
    private $conn;
    function connect() {
        $this->conn = new mysqli ('**','**','**','**');
    }
    function control () {
        $this->mail = 'aa@a.com';
        $checkmail = 'SELECT * FROM table WHERE email = ?';
        if ($stmt = $this->conn->prepare($checkmail)) {
            $stmt->bind_param('s', $this->mail);
            $stmt->execute;
            $stmt->store_result();
            $count = $stmt->num_rows;
            echo $count;
        }
    }
}
$a = new connection();
$a->connect();
$a->control();

返信ありがとうございます。

4

2 に答える 2

1

executeメソッドです:

$stmt->execute();
于 2013-11-01T07:55:55.287 に答える