You're expecting when updating the database it will auto-update in the frontend, while this is not possible.
There are many frameworks and libraries made to make this thing possible (easier) such as React
.
Now, this is the general thing that happens, how would the front end even know that the database was updated? so you must add auto-refreshing code, or the user must reload the page.
Also server cant send a request to the frontend. And server responses cannot change the frontend, the thing that changes frontend after rendering is including a script in it.
Thats' it.