<?php
   class MyDB extends SQLite3 {
      function __construct() {
         $this->open('/kirac/db/sungateway.db');
      }
   }

   $db = new MyDB();
   if(!$db) {
      echo $db->lastErrorMsg();
   }

   $db->exec("PRAGMA synchronous = OFF");

   $baudrate = $_POST['fbaudrate'];
   $databit = $_POST['fdatabit'];
   $parity = $_POST['fparity'];
   $stopbit = $_POST['fstopbit'];
   $timeout = $_POST['ftimeout'];
   $scanrate = $_POST['fscanrate'];
   $queryinterval = $_POST['fqueryinterval'];

   $sql =<<<EOF
   UPDATE tblrsconfig
   SET
   baudrate = $baudrate,
   databits = $databit,
   parity = $parity,
   stopbits = $stopbit,
   timeout = $timeout,
   scanrate = $scanrate,
   queryinterval = $queryinterval;
EOF;

   echo $sql;

   $ret = $db->query($sql);

   $db->close();
?>
