PHP - generate team based on seniority

Codes here !

Moderators: egami, macek, gesf

Post Reply
iamakid
New php-forum User
New php-forum User
Posts: 1
Joined: Sun May 24, 2020 9:49 am

Sun May 24, 2020 9:52 am

I would like to generate team by their seniority based on the available members.
For example : I have 60 members. I want use all this 60 members as teams. Each team has one leader,one asst leader, and 8 members (1+1+8) .

Code: Select all

$result = mysqli_query($con, "SELECT * FROM `members` ORDER BY DOJ,DOB");
$perteam =10;
$teamstart=1;
$teams=15;
$required=$perteam*$teams;
$data = array();
 while( $row = mysqli_fetch_array($result))  {
  $data[]=$row;
 }
 foreach($data as $fetch){
	 echo $fetch["empname"].'<br>';
}
I used the above code to fetch the members in seniority . Now I want to add another coumns Team and Designation as follows;

1.Peter - Team 1-Leader1
2.Robin - Team 2 - Leader2
… Likewise it should go…

How do I achieve this.

any lead…?
User avatar
hyper
php-forum GURU
php-forum GURU
Posts: 1190
Joined: Mon Feb 22, 2016 5:52 pm

Sun May 24, 2020 11:03 am

So what actually is your problem?

What's stopping you doing what you want?
Post Reply