I have stored a date field stored in a mySQL database which I'm trying to increment by a month.
The code gets the date then stores it in the variable $renew and then using date and mktime I'm trying to increment it by one month and store it in the variable $rdate before putting it back in the database.
The current code is:
$renewdate=getsqlrow("SELECT paymentdue FROM users WHERE id='".$user_id."'");
$renew=$renewdate['paymentdue'];
$rdate=date("Y-m-d", mktime(0,0,0, date("m", $renew)+1,date("d", $renew),
date("Y", $renew)));
However this isn't working and I'm not sure what to do to get it working. I've searched the forum but haven't come accross anything that really helps.
Thanks
Dave