druzuz321103 2012-03-22 10:07 采纳率: 100%
浏览 10

如何rowCount一个空数据

I want user to have valid email thats why i check if the comform there email.

I get the username and count the rows who have that username and Activation set to NULL,but if i echo the rowCount = 0 but there is a such a row

$checkMail = $dbh->prepare("SELECT UserID FROM users WHERE username =:username 
AND Activation=''");
$checkMail->bindParam(':username', $_POST['username']);
$checkMail->execute();
echo $exist = $checkMail->rowCount();
  • 写回答

1条回答 默认 最新

  • dsb12300 2012-03-22 10:10
    关注

    If Activation is really NULL, your query should be:

    SELECT UserID FROM users WHERE username =:username AND Activation IS NULL
    
    评论

报告相同问题?