MYSQL table won't update
<p>I am building a profile pictures system and for some reason my table doesn't seem to be working with the MYSQL UPDATE query. Below you should just select your image and click upload, it moves the image to the folder but not the directory to the database. </p>

<p>Help please:</p>

<pre><code>    if (file_exists("userdata/profile_pics/".@$_FILES["profilepic"]["name"]))
     {
echo @$_FILES["profilepic"]["name"]." Already exists";
   }
   else
    {
   move_uploaded_file(@$_FILES["profilepic"]["tmp_name"],"userdata/profile_pics/".$_FILES["profilepic"]["name"]);
 echo "Uploaded and stored in: userdata/profile_pics/".@$_FILES["profilepic"]["name"];
$profile_pic_name = @$_FILES["profilepic"]["name"];
$profile_pic_query = mysql_query("UPDATE users SET profile_pic='$profile_pic_name' WHERE username={$_SESSION['user_login']}");

  }
  }
  else
   {
  echo "Invailid File! Your image must be no larger than 1MB and it must be either a .jpg, .jpeg, .png or .gif";
   }
   }
</code></pre>
