load($propertiesFile); // Connect to the DB $username=$dbProperties->getProperty("user"); $password=$dbProperties->getProperty("pass"); $database=$dbProperties->getProperty("db"); $mysqli = new mysqli(localhost,$username,$password,$database); // Verify that the user is logged in $sql = " UPDATE diylc_user SET email= \"".addslashes($email)."\", website= \"".addslashes($website)."\", bio= \"".addslashes($bio)."\" WHERE name = \"".addslashes($name)."\" AND token= \"".addslashes($token)."\" AND machine_id = \"".addslashes($machineId)."\""; if (!$result = $mysqli->query($sql)) { echo "{\"string\":Database error.}"; exit; } if ($mysqli->affected_rows === 0) { echo "{\"string\":\"Could not update the account. ".$mysqli->error."\"}"; } else { echo "{\"string\":Success}"; } $mysqli->close(); ?>