What I want to achieve is to add 30 days to a customers subscription if the payment has been made
So I am using this code
$set = "REPLACE into CLIENTS where USR_PAID = '1' and USR_EXPIRATION = DATE(DATE_ADD(NOW(), INTERVAL 0 DAY)) values ('USR_EXPIRATION','" . $due . "')";
$update = $conn->update($set, $db);
I am getting the following syntax error
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 USR_PAID = '1' and USR_EXPIRATION = DATE(DATE_ADD(NOW(), INTERVAL 0 DAY)) values ' at line 1 Statement: REPLACE into CLIENTS where USR_PAID = '1' and USR_EXPIRATION = DATE(DATE_ADD(NOW(), INTERVAL 0 DAY)) values ('USR_EXPIRATION', '09-05-2013')
I should tell you that I am using the same function to update the db in different parts of the website and is working just fine.
Also the following query is working and gives me all the clients that have paid and expire today:
$request = "select * from CLIENTS where USR_PAID = '1' and USR_EXPIRATION = DATE(DATE_ADD(NOW(), INTERVAL 0 DAY))";
$result = $conn->query($request, G_NORMDB);
I guess it is only a syntax error that I can't figure out.