Form Functions

O

old.Mozzer

Guest
Does anyone know how to create a form which will do multiple db functions?

Instead of updating 1 field at a time I want to update them all together but how would I make sure the fileds update according to their id number?

sort of the same thing as the phpadmin uses!

eg. updating 4 member's status to Inactive at the same time. How would I do this?
 
T

Trebz

Guest
Hmm, im doing a lot of guesswork here as your post doesn't provide all the information, the SQL to update multiple users at the same time would be something akin to

UPDATE tbl SET field = value, field = value WHERE userindex IN (1, 2, 3, 4)

where 1, 2, 3, 4 are the id's of all the users you want to update.

If i've completely got the wrong end of the thread let me know :)
 
O

old.Mozzer

Guest
Just what I needed m8.

However explain the 'IN' part..
 
T

Trebz

Guest
IN basically means, that the userindex is IN the collection of id's in the parenthesis. For example, userindex IN (1, 2, 3) means that userindex is equal to one or all of those numbers.
 

Users who are viewing this thread

Similar threads

1
Replies
4
Views
643
MYstIC G
M
D
Replies
0
Views
510
doh_boy
D
T
Replies
3
Views
555
TheJkWhoSaysNi
T
A
Replies
2
Views
552
A
U
Replies
8
Views
672
Jonty
J
Top Bottom