Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Sep 2003, 03:50
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
how to UPDATE multiple inputs

I wish to display order of certain categories for eg.

Cat 1 , order : 1
Cat 2 , order : 2

( Runs thru the catorder table to display category names in ASC order of catorders. )

The orders are displayed as input boxes, which can be changed in value , say to reverse the order, i will put 2 in Cat 1's order input box and vice versa.

At the end of the form, i will click on a Submit button and the categories will have their orders updated accordingly ( i have a table column for Category order )

How should i go about doing this ?

Thanks for any help rendered.
Reply With Quote
  #2  
Old 22 Sep 2003, 16:24
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then the POST process portion:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This should work. You might get a parse error or two since I compiled this very quickly, but it shouldn't be hard to work around.
Reply With Quote
  #3  
Old 22 Sep 2003, 16:36
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Originally Posted by Velocd
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then the POST process portion:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This should work. You might get a parse error or two since I compiled this very quickly, but it shouldn't be hard to work around.
Very bad idea to query in a loop...
Reply With Quote
  #4  
Old 22 Sep 2003, 17:31
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
Then how would we get round this one?
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #5  
Old 22 Sep 2003, 19:40
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
There aren't many fast ways around it.

The method I provided is the exact vBulletin uses to update the order of forums in the Admin Cp:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The only main difference is this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Which is a check to ensure that it's not quering and updating a row when it has yet to be modified.

You could probably apply the same to the code above.
Reply With Quote
  #6  
Old 06 Oct 2003, 20:15
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
I feel ashamed to be bumping a reasonably old thread but i'm ecountering a similar issue at the moment. I want to update multiple rows in a database with one query. Any solution?
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #7  
Old 07 Oct 2003, 14:15
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
Supposedly this might work:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But I doubt it.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

[email protected]
Reply With Quote
  #8  
Old 17 Oct 2003, 02:59
TECK's Avatar
TECK TECK is offline
 
Join Date: Dec 2001
Real name: Floren Munteanu
Originally Posted by Chen
Supposedly this might work:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But I doubt it.
Whoot? You are still alive?
__________________
Floren Munteanu
Axivo Inc.
Axivo Community - Visit the forums to find out more about us
Why Queued - My personal blog
Reply With Quote
  #9  
Old 17 Oct 2003, 04:26
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Originally Posted by TECK
Whoot? You are still alive?


Will try some of the code provided here, thanks guys
Reply With Quote
  #10  
Old 17 Oct 2003, 11:10
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
Originally Posted by TECK
Whoot? You are still alive?
He's around all the time in the vBulletin.org chat TECK

Btw cinq - the best way I found of doing this was via vb3's method which VelocD highlighted
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #11  
Old 23 Oct 2003, 06:47
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Thanks Velo and Mist.

The code works wonderfully , after slight changes to the syntax
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:02.

Layout Options | Width: Wide Color: