使用if语句

时间:2016-09-08 15:15:31

标签: php html mysql forms

在有问题的script中,除了证明数据库中存在电子邮件之外,我能够做我想做的所有事情。我知道我错过了什么,留下了一些东西。在这个问题中,我只展示了不起作用的代码。 script的其余部分有效。我认为这个问题出现在if声明中,但我似乎无法弄明白。

if(empty($_POST['email']))
{

    $query_email = "
         SELECT
         email
         from users
         where
         email = :email
    ";

    $query_goes = array(

    ':email' => $_POST['email']

    );
    try
    {

        $stmt = $db->prepare($query_email);
        $result = $stmt->execute($query_goes);
    }
    catch (PDOException $ex)
    {
        die("Failed to run query: " . $ex->getMessage());
    }
    $row = $stmt->fetch();
    if($row) 
    {
        die("This email is already in use...");
    }

}

}

2 个答案:

答案 0 :(得分:0)

将您的代码更改为

library ieee;
use ieee.std_logic_1164.all;

entity assoc_elements is
    port (
        array_1 : out std_logic_vector (1 downto 0);
        array_2 : out std_logic_vector (1 downto 0)  -- ;
    );
end entity;

architecture nothing of assoc_elements is
begin
end architecture;

library ieee;
use ieee.std_logic_1164.all;

entity element_assoc_test is
end entity;

architecture test of element_assoc_test is
    signal foo1, foo2, bar1, bar2: std_logic;
begin
ASSOC:
    entity work.assoc_elements
        port map (
            -- All foo1, foo2, bar1, bar2 are defined as output std_logic in wrapper port list
            array_1 (0) =>   foo1,
            array_2 (0) =>   bar1,
            array_1 (1) =>   foo2,
            array_2 (1) =>   bar2    -- ,
        );
end architecture;

这样你的if语句就会被执行,因为$ _POST ['email']不是空的。

答案 1 :(得分:0)

你可能忘了绑定

wd.findElement(By.xpath("//div[text()='OK']")).click();