Mysql Date_ADD ranges in the same PHP code

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 is not working.

    
asked by anonymous 03.11.2018 / 23:39

1 answer

0

I think it might look like this:

$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'";
    
04.11.2018 / 17:51