这个pdo代码怎么了?

时间:2018-01-31 08:37:02

标签: php pdo

为什么这个pdo语句会出错?有人可以帮我这个吗?

if (isset($_POST["leerling"])) {
    $stmt = $conn->prepare("select * from cijfer where naam=naam");
    $stmt->bindParam(':naam', $naam);
    $klant = $_POST["leerling"];
    $stmt->execute();
    $stmt->setFetchMode(PDO::FETCH_ASSOC); 
    foreach ($stmt->fetchAll() as $row){
        echo "<tr>";
        echo "<td>" . $row["vak"] . "</td>";
        echo "<td>" . $row["naam"] . "</td>";
        echo "<td>" . $row["cijfer"] . "</td>";
        echo "</tr>";
    }
    $conn = null;
}

1 个答案:

答案 0 :(得分:2)

select * from pg_timezone_names() 更改为select * from pg_timezone_names() as t(name,abbrev,utc_offset,is_dest)