Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 9th, 2003, 10:15 PM
Laffingdonkey Laffingdonkey is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 Laffingdonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
  #2  
Old July 9th, 2003, 10:27 PM
christo's Avatar
christo christo is offline
Introspective
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Nov 2001
Location: London, UK
Posts: 3,296 christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 1 h 5 m 9 sec
Reputation Power: 101
Send a message via ICQ to christo Send a message via Yahoo to christo
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

Reply With Quote
  #3  
Old July 9th, 2003, 10:56 PM
Laffingdonkey Laffingdonkey is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 Laffingdonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Update variable amount of rows


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway