1

In my PHP application, I have a web page that says "New Leads: 0" The "0" is the result of a SQL statement.

My goal is to add Ajax code so the "0" updates dynamically, without having to refresh the page. When the number of rows increases in the database, I want the "New Leads: 0" to automatically increase.

My question is can you point me in the right direction of how I can code this?

1 Answer 1

2

Make a page that outputs the number, put the number into a <span id="the_number"> then call the load() function of jQuery on that span to fetch that page. Use the window.setInterval() function to make it periodically.

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.