PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a table that looks like the above, if the user enters data on two or more lines of the table, how would i get PHP to add the data to the database without giving all the feilds different names? I'm guessing it's going to have a while command in there, checking to see if the number of rows is bigger than number of rows of data entered insert it in, but i don't know where to start coding it. I know how to enter single variables into the database.
I'm also aiming to have any records already in the database display in the table then the line under have input fields so the customer can input new information still.
My other problem is that this site is going to be access by 3 or more people adding information, i figured i could have the results in an iframe that refreshes every 5 seconds? Or is there a better way of doing this?
[quote="Brad7928how would i get PHP to add the data to the database without giving all the feilds different names?[/quote]What does your data look like and how do you want to search/access it? You should only need to name the fields just like on your form for each column as long as you know how to select the data you need to manipulate.
As far as presenting the current data, you just make a dynamic page that dumps out your data, displays it, then waits for the user to change it or add more.
An easier way to keep things synchronized is to add a time stamp with the date/time the last changes were made and put it into the database too in a different table. Before a user submits changes, check to see if the time stamp has changed, refresh their data display and then confirm if they want to continue in light of the new changes that have occured. You could also write some Ajax code to check for updates and notify the client browser if something has changed. There's no easy way to do this with pure PHP. It will be hard for people to make changes to a dynamic form in an iframe that is refreshing every 5 seconds....