 <p>You are not referencing the <code>$id</code> variable, but rather a string text <code>id</code> which breaks the query statement. Add a dollar sign to reference the variable, and if it's anything but an integer, wrap it in single quotes, too.</p> <p><code>$query = "UPDATE utilizatori SET username = '$username', {...}, ip = '$ip' where id= '$id' ";</code></p>