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 '-userfile WHERE id='642' AND userid='459'' at line 1
This is the code
$query = "SELECT * FROM ue-userfile WHERE id='$imageid' AND userid='$userid'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
$oldalbum = $row['albumname'];
//if($oldalbum < 2){$oldalbum = "";}
//albumname = '$oldalbum' BY
$result6 = mysql_query("UPDATE ue-userfile SET albumname =$newalbum WHERE id=$imageid")or die(mysql_error());
if($result6){echo "Done!";}else echo "Something went wrong...";