UPDATE Sqlite and PHP error

Asked

Viewed 22 times

0

<?php

   $ip = $_REQUEST['ip'];
   $port = $_REQUEST['port'];

   class MyDB extends SQLite3 {
      function __construct() {
         $this->open('Tracker.db');
      }
   }

   $db = new MyDB();
   if(!$db) {
      echo $db->lastErrorMsg();
   } else {
      echo "Opened \n";
   }
   $sql =<<<EOF
      UPDATE Server SET ip, port VALUES('$ip', '$port') WHERE ip='$ip';
EOF;
   $ret = $db->exec($sql);
   if(!$ret) {
      echo $db->lastErrorMsg();
   } else {
      echo $db->changes(), " Record updated successfully\n";
   }

   $db->close();
?>

The above code takes the Ip and Port values coming via GET and makes the UPDATE in the database, in the same database I can remove and insert data...

The error returned by him and : near ",": syntax error

  • An SQL or PHP error is reported?

  • I stake that error in SQL

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.