The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Query Results for() while()
Hi, I'm trying to sort through the data to display 1 team at a time (while gathering tons of other information).
I need to get fc_team.managerid, fc_team.id, fc_team.playerid, fc_player_stats.score, fc_playerownership.playerid, fc_playerownership.roleid. Table relations: fc_team.id=fc_playerownership.teamid fc_player_stats.playerid=fc_playerownership.player id Field Info: Each player in a given team will either have a roleid of 1-27, so for each team, there should be 27 players/results. So basically I need to PHP Code:
So how should I do this? I tried using for() but that didn't help much, because I don't know how many rows to set the maximum (depends on the # of results from the query) the score selection messes this up, because it selects every player. I know I have to use while() on the array, and for() afterwards, but I'm pretty stuck, so any help would be appreciated. |
#2
|
|||
|
|||
I'm not sure what exactly you need here but this is what you would do if I understand you correctly:
PHP Code:
|
#3
|
||||
|
||||
Thanks for reply
No I'm not that imcompetent, well not anymore anyway. I need to only show my fantasy_cricket_teamplayerbit for every unique team, right now if I did while on the array, I would get a hundred or so results, depending on teams/players. Also to retrieve all the 'scores' of each player, then apply some math to them, then the final number I get by summing all the final numbers up, and show that total with each unique team. |
#4
|
|||
|
|||
Add DISTINCT to your query. That will return every unique team. Other than that you'll need to fix your query to sum up everything.
|
#5
|
||||
|
||||
Maybe something like this.
PHP Code:
|
#6
|
||||
|
||||
Thanks Link, that worked.
Since I had to get this to work on a per match basis (game = parent) I threw a while(matchquery) around it. Then I threw each team into an array to display so I can get it to display what I need (but that works). Well since I did that, somewhere along the way the part that seperates teams stopped working. I'll post that section of the code, and the $array values in a link. PHP Code:
http://world-a-team.com/aj/fantasy_c...id=20&show=yes So everytime the roleid hits 27 and resets, it should be a new team. ** solved thanks MarcoH64 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|