I am trying to write a script that archives a user by setting the value of the archive column to the value of 1 . I have written the following script to do this, but I am not sure if I am using the syntax correctly as I am am getting the following error.
<?php
mysql_query("SELECT FROM archive hqfjt_chronoforms_data_addupdatelead
WHERE cf_uid = '{cf_uid}'
SET archive='1';"
) or die(mysql_error());
?>
The error I am getting is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE cf_uid = ‘c68235f3fb5c3f7fff6247b04c450dd7’ SET archive=’1” at line 1
There’s no
SETin aSELECTstatement, and you’re missing theFROMpart.You need an
UPDATEcommand, perhaps like: