The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I have the following result set from my db:
------------------------------- | postid | post_statusid | ------------------------------- | 100 | 4 | | 101 | 7 | ------------------------------- And I am looping through the result set as follows: PHP Code:
If any posts have post_statusid of '7' set $statusid = 7 If any posts have post_statusid of '4' and NO posts have post_statusid of '7' set $statusid = 4 If no posts have post_statusid of '7' or of '4' set $statusid = 8 The result set can only have a value of 4,7, or 8. Following are all possible result sets, however the one highlighted in red is giving me a problem. It's returning '4' instead of the needed value of '7': If: 8,8 $statusid = 8 If: 8,7 $statusid = 7 If: 8,4 $statusid = 4 If: 7,8 $statusid = 7 If: 7,7 $statusid = 7 If: 7,4 $statusid = 7 If: 4,8 $statusid = 4 If: 4,7 $statusid = 7 If: 4,4 $statusid = 4 Anyone have an idea on how to get this one instance of 4,7 to return '7' as I need instead of '4'? Thanks in advance
|
|
#2
|
|||
|
|||
|
You will be better to store the post_statusid in a temp. array. Then you can make use of in_array() and a few simple if expressions.
PHP Code:
|
|
#3
|
||||
|
||||
|
perfect, thanks Opserty
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|