Mysql Date_add ranges in the same PHP code

Asked

Viewed 38 times

1

$sql2 = "UPDATE usuarios SET expira = DATE_ADD(expira, INTERVAL $diasc DAY, $horac HOUR and $minutoc MINUTE and $segundosc SECOND), expira_manutencao = '0' WHERE expira_manutencao = '1'";

I would like to use the interval of day our minute and Second at once as above, but it’s not working.

1 answer

0

I believe it could be so:

$sql2 = "UPDATE usuarios SET 
expira = DATE_ADD(DATE_ADD(DATE_ADD(DATE_ADD(expira, INTERVAL $diasc DAY), INTERVAL $horac HOUR), INTERVAL $minutoc MINUTE), INTERVAL $segundosc SECOND), 
expira_manutencao = '0' 
WHERE expira_manutencao = '1'";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.