jimlawrnc Posted November 5, 2007 Share Posted November 5, 2007 I have a form with a table. Each table row has a ID= "some number". I have 4 rows and might need to create more. how can i do this in php? To go along with this, When I hit the submit buton, I then need all the table row data saved to a db i have. I can insert 1 line with out a issue. I also made sure the table row name="" fields are unique. ex. <table> <tbody> <tr id="0"> <td>Client:</td> <td> <input size="30" name="Client"></td> <td>Hours:</td> <td><input size="10" name="Hours"></td> <td>Mileage:</td> <td><input size="10" name="Mileage"> </td> <td>Billable:</td> <td> <input name="Billable" value="Yes" type="checkbox"></td> <td>Non-Billable:</td> <td> <input name="NoBillable" value="Yes" type="checkbox"> </td> <td>Date:</td> <td><input type="text" name="datBegin" size="10"> <script language=javascript> var basicCal = new calendar("FIELD:document.frm.datBegin"); basicCal.writeCalendar(); </script></td> </tr> <!--- Add a few more rows here ---> <tr id="1"> <td>Client:</td> <td> <input size="30" name="Client1"></td> <td>Hours:</td> <td><input size="10" name="Hours1"></td> <td>Mileage:</td> <td><input size="10" name="Mileage1"> </td> <td>Billable:</td> <td> <input name="Billable1" value="Yes" type="checkbox"></td> <td>Non-Billable:</td> <td> <input name="NoBillable1" value="Yes" type="checkbox"> </td> <td>Date:</td> <td><input type="text" name="datBegin1" size="10"> <script language=javascript> var basicCal = new calendar("FIELD:document.frm.datBegin1"); basicCal.writeCalendar(); </script></td></tr> This repeats on 2 more times So to recap. I need to A. create another table row as needed via button. B. capture all the data on the form and submit to the DB C. check for empty data if so stop at that point assuming thats all the data at this time. D. loop through the data and send it on its way. One more Q. can i have 2 mysql_query statements in the same php form? it seems if i try to perform 2 of these then the page doesn't work correctly. To top things off, I would like to generate a table with the data that was submitted on a report page after submitting. Thank you to all If you require more info i'll provide what i have. I also have a live site i can test this all out on and if needed give you access to the page Quote Link to comment Share on other sites More sharing options...
trq Posted November 5, 2007 Share Posted November 5, 2007 I have 4 rows and might need to create more. how can i do this in php? You have four fields[/i]. And it would be poor design to warrant creating more. There is a link in my signiture to a free php book, within the database section of that book is a sub section on database nromalization techniques. You should read it. Quote Link to comment Share on other sites More sharing options...
jimlawrnc Posted November 6, 2007 Author Share Posted November 6, 2007 Excellent read Thank you it has helped much. My question tho was more pertaining to the html table structure as in creating another row there with php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.