I created a form with two forms on it. The first form is a search box that pulls the data. The second form takes the generated data and displays it in a table with user text inputs. The form submits back to the page and shows only the search box and no data table. In other words it redirects back to the search box. My issue is that none of the data will post to the database.

Key info
DB fields for the text fields are varchar 6 and datatime.
The varchar 6 user input is restricted to 2 digits.
The date field is generated from php and is read only.

I have a hunch what it is but need some direction.

My solution is to take the generated search data and have it display in a table and save the data to a temp table. Upon submit I will have it display the table again from another file with the text fields inputs for submission to the database.

What issues do you see if I implemented this change?

    Not sure we have enough info to really know what the "problem" is, but my hunch for now is that a temporary DB table is not the solution. If the issue is keeping track of what data is being worked with between page requests, I think a session variable(s) probably makes more sense, likely an array of data within the $_SESSION array. But it could be something as simple(?) as a malformed HTML form not doing what you think it should be.

      5 days later

      Thanks for the input. After reading your post and rereading my own post I figured it out and got it to work. I basically broke my original php file into into three php files. One for search, one for the data table, and one for the php and db calls.

        Write a Reply...