I'm trying to insert records into my DB, if a duplicate is found it should only update one field.
This is my code so far
$strSQL = "INSERT INTO ppage_image_uploads(Cons_ID, Img_SRC, Program, TeamRaiser_ID)
VALUES
('" . $_POST["cons_id"] . "',
'" . $_POST["img_src"] . "',
'" . $_POST["program"] . "',
'" . $_POST["tr_id"] . "')
ON DUPLICATE KEY UPDATE
Img_SRC = VALUES '" . $_POST["img_src"] . "'
)";
Took this loosely from another question: MySQL ON DUPLICATE KEY UPDATE for multiple rows insert in single query
I'm ending up with an error message from my page that handles this script saying
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''theimageurl.jpg' )' at line 8
Does anything look wrong in that statement that I'm missing?