0

Sample

As you See the Above picture is where i want to load the Counts from the array dynamically from the db.In this code iam using it as static how to show the count Dynamically ? This is the code i am currently using

       <h3 class="card-title fw-l"><?php echo  $dispcnt[0]->cnt;?> Counts</h3>```


I work in CodeIgniter
1
  • Refresh the page and they are dynamic. Seriously tough, if i understood correctly, you want to have the counters updating dynamically once rendered in the page correct? If that's the case, and excluding more complicated solutions, you need javascript. Commented Sep 23, 2021 at 12:09

1 Answer 1

1

Try this solution:

<?php
foreach($dispcnt as $object)
{
?>
    <h3 class="card-title fw-l"><?php echo  $object->cnt;?> Counts</h3>
<?php
}
?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.