- Impact
- 32
Okay I'm having a bit of a problem. (notice it's 5am :o )
I have a query that loops through a max of 5 values. Then within that loop, I need to update 5 different fields with those different values. So essentially I need to run a different query for each value. (I think)
Currently have it as: (which of course doesn't work)
Where $uid contains the 5 different values and $recipient1 through $recipient5 need to be filled.
Any ideas? I lack the fundamentals of php but I can't find the answer to how I should structure this.
Many thanks,
-Ryan
I have a query that loops through a max of 5 values. Then within that loop, I need to update 5 different fields with those different values. So essentially I need to run a different query for each value. (I think)
Currently have it as: (which of course doesn't work)
Code:
if($recipient2 =="0" && $recipient1 != $uid){ query2 }elseif($recipient3 =="0" && $recipient2 != $uid && $recipient1 != $uid ) { query3 }etc etc
Where $uid contains the 5 different values and $recipient1 through $recipient5 need to be filled.
Any ideas? I lack the fundamentals of php but I can't find the answer to how I should structure this.
Many thanks,
-Ryan
Last edited: