$sql2="INSERT INTO friend_featuredusers (user_id, featured, startdate, enddate) VALUES ($userid, '1', NOW(), DATE_ADD(NOW(), INTERVAL 30 DAY))";
executeUpdate($sql2);
I have this code above that inserts a record into the DB and the enddate value is set to 30 days from current date, What I want to do is if a record exist I want to update that record by taking the value of enddate and increasing it by 30 days.
I tried this code below but it sets enddate to this 0000-00-00 00:00:00
any help greatly appreciated
$sql="update friend_featuredusers set enddate='DATE_ADD(NOW(), INTERVAL 30 DAY' where user_id=$userid";
executeUpdate($sql);