Hi,
i'm struggling wiht my sql date statment.
I have read the MySql manual regarding this, but somehow can't achieve what I'm trying to do.
all I want, is for the current date today :2006-03-02 to change into a "newdate" value when adding to it the value $row_rsusers['validity'].
$row_rsusers['validity'] = number of month to be added.
so this value is between 1 t0 12
I am trying to say as an example:
if CURRENT_DATE = 2006-03-02 + $row_rsusers['validity'] = 2
then $newdate = 2006-05-02
And this is where I'm stuck.
My statement below DOES add month and changes the date but not "adding2 in a correct way. the result value is not right.
How do I fix this? any idea?
SELECT DATE_ADD(CURRENT_DATE ,INTERVAL (1-MONTH(CURRENT_DATE)+'".$row_rsusers['validity']."') MONTH) AS newdate
FROM users
Many thanks.