I have an application that is working with MySQL database and PHP. There is data in this bd that is updated frequently because it is a vote, but this vote occurs on an external website and my site only displays the rank with the total votes.
To make this rank more dynamic, I wanted to keep a constant connection with db so that rank will update whenever a new vote is counted in the database, without the need for a refresh.
$rank = $_POST["rank"] // Nesse caso usarei o rank de músicas.
$query = mysqli_query($conn, "SELECT * FROM $rank ORDER BY votos LIMIT 0, 10");
A very brief example of how data is displayed.
I use an echo to return to the site the html that is generated on the php page itself and jquery displays.