![]() |
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. :D |
PHP Code:
PHP Code:
|
Quote:
|
Then how would we get round this one?
|
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. |
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?
|
Supposedly this might work:
Code:
UPDATE table SET order = IF(id = 1, 1, IF(id = 2, 2, 3)) WHERE id IN (1, 2, 3); |
Quote:
|
Quote:
Will try some of the code provided here, thanks guys :) |
Quote:
Btw cinq - the best way I found of doing this was via vb3's method which VelocD highlighted :) |
All times are GMT. The time now is 12:30 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|