Auto-refresh on post

Good day

I have a modal on my PHP file containing a table of the MySQL table. On the modal, I do an insert on the MySQL database table. Once I hit the save button the modal closes and the PHP webpage displays but the table contents does not update.

Is there a way to accomplish this without reloading the page?

Yes, using javascript. Either take the data from the modal and insert it into the table, or fetch the data from the server and insert it. It sounds like you’re already posting this to the server side using javascript so if you respond with the newly created object just use that data to insert a new row into the table.

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service