Skip to content
Advertisement

Increasing HTML table with PHP

I’m having problems with my work – I want to automatically insert a table when user registers. I’ve already finished the registration part but how can I show another user the users registered with table tag?

Advertisement

Answer

There are two ways to achieve this:

  • If you are using form submit and redirection than put the table in a foreach() loop with the data array coming from database table. Then when ever user comes on this page it takes all the newly added values and render the table.
  • Use jQuery Ajax to save the data and append new <tr> row into table body.
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement