|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Update variable amount of rows
Say I read in 'x' amount of rows from a database, and on a webpage have an input field for each row. On submit I want to update each row based on the value of the input field. How should i go about doing this? Been stuck on this for a while
Any help would be appreciated! |
|
#2
|
||||
|
||||
|
This is going to depend entirely on what database you are using and what middleware/scripting language you are using to talk to it.. however, the usual way to achieve what you are doing is to identify every record in a table with a primary key, and then you can maintain your referential integrity by always passing primary keys around your application (eg up to the client, then back down in the form to some php, which will then carry out an update).
If you could provide more info, eg a table description and some of the PHP you are trying to accomplish this with, it'd be eaiser to comment. christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
|
#3
|
|||
|
|||
|
Well I'm using PHP/Mysql (surprise surprise)
Well the table concerned is called shopinv. its fields are: inv_id - primary key... shop_id - which shop the item is in item_id - what item it is cost - how much it costs I query all rows where the shop_id is equal to the current shop, and display all the items, each with a input box contains the cost. The user can change the values and on submit have all the items costs update to the newly entered values. |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Update variable amount of rows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|