When I execute my php script with this sql code:

$key = "aaaabbbbccccddddeeeeffffgggghhhh";
$con = mysql_connect($sql_host, $sql_user, $sql_pass) or die ('Error connecting to mysql'.mysql_error());;
mysql_select_db($sql_db, $con) or die("Could not select $sql_db");
// To work in "utf-8":
$query = "set names 'utf8'";
$result = mysql_query($query);
// Query:
$query = "UPDATE personaldata SET Key='".$key."' WHERE Id='".$Id."'";
	mysql_query($query) or die(mysql_error());
	mysql_close($con);

I obtain this error:

SELECT command denied to user 'userwrite'@'localhost' for column 'Id' in table 'personaldata'

But I am not using the "SELECT" command but "UPDATE"!!! Does it has any sense?

Some where else you have written select query ,check once again in included pages also.
Your update query is quietly perfect.
This error is because you don't have privileges to use select command or you are not logged in to database as administrator.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.