Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 19:43

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



PHP counting problem

Discussion on PHP counting problem within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
mlukac89's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
PHP counting problem

Hi
I have this piece of code and i need to get teams by rank based on team points, but it wont work as i planned to

Here is image



Code:
<table width="100%" class="ladder-table2">
	<tr>
		<th style="width:7%;">#</th>
		<th style="width:70%;">Team</th>
		<th style="width:6%;">W</th>
		<th style="width:6%;">D</th>
		<th style="width:6%;">L</th>
		<th style="width:12%;">Points</th>
	</tr>
	<?php

		$position = 1;
		foreach ($get_team_id as $gti)
		{
			$tid = $gti['team_id']; // team id

			// get teams points
			$get_team_points = $teams->ladders_get_team_points($id, $tid);

			// get team name
			$get_team_name = $teams->ladders_get_team_name($tid);
			foreach ($get_team_points as $gtp)
			{
				foreach ($get_team_name as $gtn)
				{
					echo '<tr>';
					echo '
						<td>'.$position.'</td>
						<td><a href="index.php?page=teams&teamID='.$gtn['id'].'" title="'.$gtn['team_name'].'">'.$gtn['team_name'].'</td>
						<td>'.$gtp['team_wins'].'</td>
						<td>'.$gtp['team_draws'].'</td>
						<td>'.$gtp['team_loses'].'</td>
						<td>'.$gtp['team_points'].'</td>
						';
					echo '</tr>';
				}
			}
		$position++;
		}
	?>
</table>
mlukac89 is offline  
Old 05/25/2014, 18:45   #2

 
Synatex's Avatar
 
elite*gold: 25
Join Date: Apr 2010
Posts: 1,019
Received Thanks: 331
There is a cool function called sort ( ) which should help you.
Synatex is offline  
Reply


Similar Threads Similar Threads
best spam counting until 1,000,001
08/16/2008 - Off Topic - 9 Replies
1
Counting
11/30/2007 - Conquer Online 2 - 1 Replies
My story is that I'm not a really big contributer of the epvpers forums, and I'm doing this because I want to contribute something but I have dial-up connection so I cant really contribute with that. I took this idea from someone that already did this (cant remember who). Anyways, the instructions are this, i'll start the thread with the number 1 and each person counts up to the number 999. Its simple. So lemme start. 1
Counting thread
05/04/2007 - Conquer Online 2 - 16 Replies
dont post more than once and if u dont wanna count dont flame plz its just a little fun since this is a question forum the question is.....how many of us are there?..... ill start 1



All times are GMT +1. The time now is 19:44.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.