[新增]
$sql = "INSERT INTO table_name(col1,col2,......coln) VALUES($var1,$var2,......$varn)";
$result = $db->exec($sql);
[修改]
$sql = "UPDATE dbname SET col1='$var1',col2='$var2',......coln='$varn' WHERE ......";
$result = $db->prepare($sql);
$result->execute();