Page 1 of 1

PHP - generate team based on seniority

Posted: Sun May 24, 2020 9:52 am
by iamakid
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…?

Re: PHP - generate team based on seniority

Posted: Sun May 24, 2020 11:03 am
by hyper
So what actually is your problem?

What's stopping you doing what you want?