I am trying to make a dynamic for loop with some database connection.
<?php for ($i = 1; $i <= 8; $i++): ?>
<?php echo $question[0]->option
<?php endfor; ?>
Where the option is in database stored like this: option1, option2, option3 etc..
I have the $i variable which does the counting, but I do not know how I put that into the $question[0]->option variable. Tried $question[0]->option,$i etc, but no luck.
Try this: