setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); # $connection->setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); # $connection->setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $cmd = " create table $table ( name varchar(50) not null, red int, green int, blue int ) "; try { $count = $connection->exec ($cmd); if ($count === FALSE) Info ("Cannot create table
"); } catch (PDOException $e) { Info ("Cannot create table
"); } $cmd = " insert into $table values ('blede modra', 128, 128, 255) "; $connection->exec ($cmd) or Err ("Cannot insert values
"); $cmd = "select * from $table"; $results = $connection->query ($cmd) or Err ("Cannot select values
"); ?> fetch ()) { echo " "; for ($k = 0; $k < 4; $k++) { $value = $data [$k]; echo ""; } echo " "; } } ?>
$value
getMessage()); } ?>