0

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>
2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by mwasif
0

You need to provide privileges to somethin_root (or whatever user you have created on your hosting) not the root. root user is not available on shared hosting environment.

0

Thanks brother mwasif.
I provide all the previliges
to user somethin_root
but the problen doesnot solved.
I also tried for user somethin_admin
also for user somethin_aman
but the result is same.
what can i do now?

0

Run the following query to show the user's current rights

SHOW GRANTS FOR 'somethin_root'@'localhost';
0

Thanks a lot @brother mwasif.I solved my problem.
removing `friendsdb`. on line 15.
thanks a lot again.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.