Direct SQL Query in Magento 2
$sql = "UPDATE ".$table." SET `value` = '".$newMetaTitleValue."' WHERE value_id = ".$id;
$connection->query($sql);
dispaly result
xception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Sky-ukeydeal' WHERE value_id = 9718' at line 1, query was: UPDATE catalog_product_entity_varchar SET `value` = 'No Man's Sky-ukeydeal' WHERE value_id = 9718
Exception #1 (PDOException): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Sky-ukeydeal' WHERE value_id = 9718' at line 1