I Can't upload imige as my database donot support update although i give all previliges to the user root.Whats the problem??
Please Any one help me.The same code work on local PC.
The link is:
http://csefriends.com/index.php?page=auth/change_image.php
The code is given below:
<?php
$id=$_SESSION['userid'];
$name=$_POST['name'];
$fname=time();
$type= ".jpeg";
$fname = $fname.$type;
$uploaddir = 'upload/';
$uploadfile = $uploaddir . $fname;
if(move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
$success="Data Added Successfully";
} else{
$success= "There was an error uploading the file, please try again!";
}
$q="UPDATE `friendsdb`.`user` SET `link` = '$uploadfile' WHERE `user`.`id` ='$id' LIMIT 1 ;";
if(mysql_query($q)) echo "Your image uploaded successfully.";
else echo mysql_error();
?>
<script language='javascript'>
alert('<?php echo $success; ?>');
</script>
<html>
<head>
</head>
</html>