•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,580 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,610 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2213 | Replies: 2
![]() |
Alright, this one has me stuck. I know it's possible, because I've seen an example in another thread, but mine is slightly different, and I can't figure it out.
Ok, I have one script that pulls all the rows from a database, and displays the data using a while loop. It displays that data in forms, so the user can change it, and hit a submit button.
I need that form to be able to update any rows that the user changes on it. (or all of them even if they haven't changed, that's probably easier.)
How do I pull the entries from each of the rows to update all those rows with the new data?
Here is a thread that is accomplishing what I'm trying to do, but it's so long and complicated, I can't make sense of it: http://www.daniweb.com/forums/showth...+in+while+loop
Ok, I have one script that pulls all the rows from a database, and displays the data using a while loop. It displays that data in forms, so the user can change it, and hit a submit button.
I need that form to be able to update any rows that the user changes on it. (or all of them even if they haven't changed, that's probably easier.)
How do I pull the entries from each of the rows to update all those rows with the new data?
Here is a thread that is accomplishing what I'm trying to do, but it's so long and complicated, I can't make sense of it: http://www.daniweb.com/forums/showth...+in+while+loop
•
•
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation:
Rep Power: 3
Solved Threads: 68
Sorry,but the link does not exist..
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
http://ryantetek.wordpress.com
Sorry, try this one.
And like I said, the one in that post is way more than I'm trying to do, but it addresses the same problem I'm having. In the simplest form, I've got something like this:
So I basically need to know how to pass the array of variables that this table produces from the form input field named "total$id" on to the form script, so that it can process all those values.
And like I said, the one in that post is way more than I'm trying to do, but it addresses the same problem I'm having. In the simplest form, I've got something like this:
php Syntax (Toggle Plain Text)
<? echo "<table> <tr> <th>Column1</th> <th>Column2</th> <th>Column3</th> </tr> <form method='post' action='myform.php'>"; $query = "SELECT * FROM mytable"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $id=$row['id']; $mynum=$row['mynum']; echo "<tr> <td>Value 1</td> <td>Value 2</td> <td><input type='text' name=total$id value='$mynum'></td> </tr>"; } echo "<tr><td><input type='submit' name='submit' value='Submit'></form></td></tr></table>"; ?>
So I basically need to know how to pass the array of variables that this table produces from the form input field named "total$id" on to the form script, so that it can process all those values.
Last edited by nathanpacker : Nov 4th, 2007 at 9:34 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- insert multiple rows in database (MS SQL)
- Store multiple selection from pagination info into single array (PHP)
- How to store multiple selection? (VB.NET)
- Update Multiple Records (ASP)
- updating multiple rows with one form (PHP)
- multiple row update (C#)
- how do i update to Access db? (C#)
Other Threads in the PHP Forum
- Previous Thread: Dynamically updating values in a form as you type?
- Next Thread: Problem Setting up PHP/SQL Server dev enviroment


Linear Mode