I Sql server i use this command to insert value and if the id already exist update the vale
string commandLine = "IF NOT EXISTS(SELECT clientid FROM Rating WHERE clientid = " + clientId + " AND userid = " + userid + ") " +
"INSERT INTO Rating VALUES(@clientId,@userid,@rating) " +
"ELSE " +
"UPDATE Rating SET rating=@rating WHERE clientid = " + clientId + " AND userid = " + userid + ";";
And i now move to MySQL and this command won't work. there is any thing same in MySQL?