PHP虽然cicle继续加载并给出错误

时间:2017-08-29 19:27:35

标签: php while-loop

我有以下代码,但当我在我的网站上执行它时,该网站给我内部服务器错误500

$Data = $con->prepare("SELECT Example1,Example2,Example3,Example4 FROM SITES WHERE Email=:Email");
$Data->execute(array(
    ':Email' => $Email,
));
if ($Data->rowCount() > 0) {
    $Rows = $Data->rowCount();
    $CL = 1;
    $Result = $Data->fetch(PDO::FETCH_ASSOC);
    while ($CL <= $Rows) {
        $Example1 = $Result['Example1'];
        $Example2 = $Result['Example2'];
        $Example3 = $Result['Example3'];
        $Example4 = $Result['Example4'];
        $CL = $CL++;
        echo
        '<tr class="tr">
                        <td class="td"><?=$Example1?></td> 
                        <td class="td"><?=$Example2?></td> 
                        <td class="td"><?=$Example3?></td> 
                        <td class="td"><?=$Example4?></td> 
                        <td class="td"></td>  
                    </tr>';
    }
}

我想要email=:email php将打印现有表格的html行的每一行。谢谢你的建议,祝你有个美好的一天!

1 个答案:

答案 0 :(得分:0)

试试这个{让我们知道它是否适合你}

$characters = $_GET["search"];
$characters2 = "%". $characters . "%" ;
$statement = $connection->prepare(
    "SELECT name,username FROM users WHERE 'name' LIKE :username or 'username' LIKE :username");
$statement->bindParam(':username', $characters2, PDO::PARAM_STR);
$statement->execute();