diff --git a/sync-module/sync_model.php b/sync-module/sync_model.php index 1212b07..458ecbe 100644 --- a/sync-module/sync_model.php +++ b/sync-module/sync_model.php @@ -30,7 +30,10 @@ public function __construct($mysqli) public function remote_load($userid) { $userid = (int) $userid; - $result = $this->mysqli->query("SELECT * FROM sync WHERE `userid`='$userid'"); + if (!$result = $this->mysqli->query("SELECT userid,host,apikey_read,apikey_write FROM sync WHERE `userid`='$userid'")) { + return array("success"=>false, "message"=>"SQL error"); + } + if ($row = $result->fetch_object()) return $row; return array("success"=>false); }