Hi all.
I have a table which shows all the data correctly. No problem there.
The table has the following structure:
feild 1 = ID
feild 2 = staff_name
feild 3 = staff_position
feild 4 = staff_location
feild 5 = depart_id
example:
ID = 1
staff_name = fred smith
staff_position = manager
staff_location = ley
depart_id = 1
ID = 2
staff_name = john doe
staff_position = manager
staff_location = ley
depart_id = 1
ID = 3
staff_name = les jones
staff_position = manager
staff_location = ley
depart_id = 1
When the data is displayed it shows the "staff_position" for each member of staff.
What I want to do is to show the "staff_position" ONCE for all the staff members with the same position.
Anyone have any ideas.
The code I am using to display the record is this:
$maxRows_ley_staff = 70;
$pageNum_ley_staff = 0;
if (isset($_GET['pageNum_ley_staff'])) {
$pageNum_ley_staff = $_GET['pageNum_ley_staff'];
}
$startRow_ley_staff = $pageNum_ley_staff * $maxRows_ley_staff;
mysql_select_db($database_ley_community, $ley_community);
$query_ley_staff = "SELECT * FROM ley_staff WHERE depart_ID = '7' ORDER BY id ASC";
$query_limit_ley_staff = sprintf("%s LIMIT %d, %d", $query_ley_staff, $startRow_ley_staff, $maxRows_ley_staff);
$ley_staff = mysql_query($query_limit_ley_staff, $ley_community) or die(mysql_error());
$row_ley_staff = mysql_fetch_assoc($ley_staff);
if (isset($_GET['totalRows_ley_staff'])) {
$totalRows_ley_staff = $_GET['totalRows_ley_staff'];
} else {
$all_ley_staff = mysql_query($query_ley_staff);
$totalRows_ley_staff = mysql_num_rows($all_ley_staff);
}
$totalPages_ley_staff = ceil($totalRows_ley_staff/$maxRows_ley_staff)-1;
Thanks in advance