-2

Why is my PDO fetch not returning any rows from the table?

    $sql = "SELECT * from ts_rounds WHERE current=:current";
    $stm = $pdo->prepare( $sql );
    $stm->execute( array( ':current' => 1 ) );
    $rows = $stm->fetch();
    echo $row["name"];
4

1 に答える 1

1

1 行目の = の後に : を入れます。

$sql = "SELECT * from ts_rounds WHERE current=:current";
于 2013-02-17T19:14:27.270 に答える