Jump to content

Trying to update multiple records


steve m

Recommended Posts

Hi All,

I'm trying to write a script where I can change for example, multiple prices from a dynamically created form.  I first have a form where it get info from the database and displays it in a list.  What I did was where the field that I want to be able to change I made it a text box.  This works fine.  The problem that I'm having is the POST.  In the text box value I made it an array, so when I submit the form it shows me all of the values for that text box if I use a foreach loop.

[code]<? php echo "<input type=\"text\" value=\"$cst\" name=\"cst[]\" size=\"5\">"; ?>[/code]

$cst is the cost field.

What I want to do is to go thru that array and update the records, but I can't seem to figure out on how to associate the record Id(inv_id) to the $cst when submitting the form.  I need to query the database to look up the inv_id to update the cost column.

Does anyone have any ideas on how to solve this dilemma?
Link to comment
https://forums.phpfreaks.com/topic/26453-trying-to-update-multiple-records/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.