I have applied a insert query but its giving error .
$registerquery = mysql_query("INSERT INTO `registration`(`Activation`) VALUES('".$activation."') WHERE email= '". trim($_POST['email']) ."'");
I have applied a insert query but its giving error .
$registerquery = mysql_query("INSERT INTO `registration`(`Activation`) VALUES('".$activation."') WHERE email= '". trim($_POST['email']) ."'");
if you want just update a column in table so you need an UPDATE
not INSERT
.
and also you should sanitize you POST variable to prevent sql injection.
$email = mysql_real_escape_string($_POST['email'])) ;
$registerquery = mysql_query("UPDATE `registration`
SET `Activation` '".$activation."'
WHERE email= '". trim($email) ."'");
It seems you are trying to overwrite an existing value use an UPDATE statement and not an INSERT statement this is the reason why it is not working. INSERT works when you are trying to insert a new value there should not be a condition in it (where clause).
check this registration
(Activation
) it does not seem correct, the ` should maybe be ' and maybe you should start the query with @ in order to avoid sql injection attack
Use update statement instead of INSERT to use where clause
$registerquery = mysql_query("UPDATE `registration`
SET `Activation` = '".$activation."
WHERE email= '". trim($_POST['email']) ."'"
);