$conn->execDml("create table t(id integer not null primary key auto_increment, a varchar(30), b integer, d date, t timestamp default current_timestamp)");
Txx($conn->execDml("insert into t(a, b) values ('first', 1)"));
Txx($conn->execDml("insert into t(a, b, d) values ('second', 2, '2020-10-20')"));
Txx($conn->execDml("insert into t(a, b, d) values ('second', 2, '2020-05-15')"));
if($this->throw){
Txx($conn->execDml("insert into t(id, a, b) values (2, 'conflict', 3)"));
}
$conn->commit();
}
$do=2;
if($do==0){
$row=$conn->fetchRow("select a, b from t where b = 1");
Txx("b==1",$row);
$row=$conn->fetchRow("select a, b from t where b = 100");
Txx("b==100",$row);
$rows=$conn->fetchRows("select a, b from t");
Txx("all",$rows);
$rows=$conn->fetchRows("select a, b from t where b > 100");
Txx("all b>100",$rows);
}
if($do==1){
$rows=$conn->fetchRows("select * from t");
foreach($rowsas$row){
Txx("row",$row);
}
}
if($do==2){
$rows=$conn->query("select * from t")->execute();
foreach($rowsas$row){
Txx("row",$row);
}
}
if($do==4){
$q=$conn->query("select * from t where d > :date");