The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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. |
#2
|
||||
|
||||
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
Quote:
|
#4
|
||||
|
||||
Then how would we get round this one?
|
#5
|
||||
|
||||
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: PHP Code:
PHP Code:
You could probably apply the same to the code above. |
#6
|
||||
|
||||
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?
|
#7
|
||||
|
||||
Supposedly this might work:
Code:
UPDATE table SET order = IF(id = 1, 1, IF(id = 2, 2, 3)) WHERE id IN (1, 2, 3); |
#8
|
||||
|
||||
Quote:
|
#9
|
||||
|
||||
Quote:
Will try some of the code provided here, thanks guys |
#10
|
||||
|
||||
Quote:
Btw cinq - the best way I found of doing this was via vb3's method which VelocD highlighted |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|