对于PHP不增加

I have a table of users in a database, where I have the following fields:

id_usuario
login
passwd
dias_disponibles (Fixed users have 24 days available)
fecha_ingreso (Date entry in company)
tipo_usuario (Fixed or Temporary)

Each user can make a vacation request. The user admin is responsible for adding the new users. My problem is with temporary users. A temporary user will have the available days according to the months worked up to one year. For every month worked, dias_disponibles is increased by 2. For example, if user1 since joining the company, it has been working for 2 months now it will have 4 dias_disponibles and so on until it takes 12 months, then from there, it will always be 24 dias_disponibles . I have this function that calculates the difference of months since I joined the company until today:

function difmeses($fechaingreso){
$fechainicial = new DateTime($fechaingreso);

$fechaactual = (new DateTime)->format('Y-m-d H:i');
$fechafinal = new DateTime($fechaactual);

$diferencia = $fechainicial->diff($fechafinal);

$meses = ( $diferencia->y * 12 ) + $diferencia->m;

return $meses;
}

My question is what to use so that it increases until 12 months in the company, if it takes 12 months, stop. I have created this for, but I do not know how to continue so that it increases in 2 days available:

$mes = difmeses("2018-03-15 00:00");
for($i = 1; $mes <= 12; $i++){
mysql_query("update sec_users set dias_disponibles = dias_disponibles + 2 where login = 'user1'");
}

It does not do what I want very well.

First of all your logical problem

The problem you have is in your last part of the code

$mes = difmeses("2018-03-15 00:00");
for($i = 1; $mes <= 12; $i++){
    mysql_query("update sec_users set dias_disponibles = dias_disponibles + 2 where login = 'user1'");
}

First of all, there is no need at all to use a for loop here. You overwrite the update commands of the previous runs of the loop, so at the end only the last one will be in the table. Because of this you can work with the last one without a loop.

Sencond you got a really simple formula here: Free days = (month worked * 2) max 24. Just write that down as code:

$mes = difmeses("2018-03-15 00:00");
$dias = max($mes * 2, 24);
mysql_query("UPDATE sec_users SET dias_disponibles = $dias where login = 'user1'");

Now another huge problem

Do not use the mysql_ functions. They are deprecated! Instead use the mysqli_ functions or PDO and read about prepared statements.