1) I open a page (t1.php) on it there is a Select option, each select contains a unique id, as soon as I select the select value I press a button (Id is sent to the server using the POST method), then the id is sent to the sql query and builds a table by the id chosen by me and I get on the page t2.php

2) on the t2.php page, the table opened, then inside the table there is a form that sends data to the server on the same t2.php page and as soon as the data is sent, the table breaks down and the data disappears and only the table layout remains + while the query is executed.

Who can tell why this is happening? It may be necessary to save the id in the session so that the value is not lost when sending data from the form
enter image description here
The bottom image is displayed after clicking the submit button inside the form enter image description here

  • html can be seen? - L. Vadim
  • @ L.Vadim, added - Eliot

1 answer 1

It is possible that when the t2.php page is called again, the script re-creates the table, while first destroying it (drop) or emptying (truncate). At the same time, the data that should be included in the table is no longer recorded, since nothing was sent by the POST method.

There are two possible solutions:

  1. instead of calling t2.php again, call the t3.php page in which to write the necessary script.
  2. if the re-call t2.php is nevertheless inevitable, then check a certain parameter by which it will be clear whether the page is called at the first or the second time.

But for the exact answer the script of the t2.php page is needed.