I'm trying to apply a simple FOR/ENDFOR to a PHP page

I’m trying to apply a simple FOR/ENDFOR to a PHP page.
I have to repeat a maximum of 17 times (this is the maximum number of records I have to show).
So I applied a simple FOR/ENDFOR PHP.
This is FOR:

<?php for ($qd = 1; $qd <= 17; $qd++): ..... <?php endfor; ?>

If I leave it like this <= 17, I can repeat 17 times but I want to replace the 17 with a Mysql field, in this case this field: {{sc_single_destino.data.query.pct_dias_quant}}
If I apply this field in FOR/ENDFOR:
$daysTotal = “{{sc_single_destino.data.query.pct_days_quant}}”;
for ($qd = 1; $qd <= $daysTotal; $qd++):

endfor;
The code crashes and the page loads infinitely until I close the browser tab.

How can I make this FOR/ENDFOR to show the correct number of records?

Community Page
Last updated: