This topic is locked
[SOLVED]

 add days to the current date.

11/26/2013 9:10:12 PM
PHPRunner General questions
J
joiresende author

I have the following application:
global $conn;

if($values['Tipo'] == 'Fatura')

{

$strSQLInsert = "insert into faturas (total, expiration_date)
value('".$values["total'".$values["current_date"]."')";
db_exec($strSQLInsert,$conn);

}
I would like to add thirty days from the current date
in other words
expiration_date = current_date + 30 days
Thank you for your cooperation

C
cgphp 11/27/2013
global $conn;

$expiration_date = date('Y-m-d h:i:s', strtotime($values["current_date"]. ' + 30 days'));

if($values['Tipo'] == 'Fatura')

{

$strSQLInsert = "insert into faturas (total, expiration_date) values ('".$values["total"]."','".$expiration_date."')";

db_exec($strSQLInsert,$conn);

}
J
joiresende author 11/27/2013

thank you very much

the way to version 7.0