PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table t ( id int, piece int(32) not null default 1 );
Copy Clear
Copy Format Clear
<?php $query = "insert into t values (?, ?);"; $stmt = $pdo->prepare($query); $stmt->execute([1, null]); $query = "select * from t;"; $stmt = $pdo->prepare($query); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); var_export($rows);
Show:  
Copy Clear