I am having some problems when trying to update a MYSQL database table using PHP. Here go the code I am using:
PHP:
/*** update Field*/
$conn = mysql_connect("localhost", "user", "pass");
mysql_select_db("database",$conn);
$sql = "UPDATE users SET pic = ".$newname." WHERE username = ".$session->username."";
if (mysql_query($sql, $conn)) {
echo "record added!"; }
else {
echo "something went wrong";
}