I need another pair of eyes to try to assist me.
What I am trying to do is display records from a view within SQL Server 2000 to the PHP web page. The records are already grouped/sorted on the db backend.
I would like my output to be as follows:
Status: [Value]
Team: [Value]
Manager: [Value]
[List Employees]
Therefore, for each Status display its value once. For each Team, display its value once. For each Manager, display its value once and list his/her employees.
Like this ....
[highlight #FF99FF]
Status: Accepted
Team: Human Resources
Manager: John Doe
Doe, Jane
Park, Deer
Cola, Coke
Manager: Jane Doe different Manager within Team HR
Doe, John
Deer, Park
Coke, Cola
Team: Business different Team but Status = Accepted
Manager: John Doe
Doe, Jane
Park, Deer
Cola, Coke
Status: Assigned new Status
Team: new value
Manager: new value
new value(s)
-- Repeat format until end of records in db --
[/highlight]
The code I've written outputs like this:
Status: Accepted
Team: Human Resources
Manager: Unknown
Doe, Jane
Status: Accepted
Team: To Be Determined (TBD)
Manager: Unknown
Doe, Jane
Park, Deer
Cola, Coke
Status: Assigned
Team: Business
Manager: Unknown
Jackson, Michael
Status: Assigned
Team: Business
Manager: Bird, Larry
Murphy, Eric
Status: Assigned
Team: Business
Manager: Fowler
Marino, Geronimo
However, the employees are within their respective places under the Manager. I just don't understand why the Status and Team are duplicated.
Here's a snippet of the code I've written:
Any assistance/guidance is much appreciated.
Thanks,
Nicole
What I am trying to do is display records from a view within SQL Server 2000 to the PHP web page. The records are already grouped/sorted on the db backend.
I would like my output to be as follows:
Status: [Value]
Team: [Value]
Manager: [Value]
[List Employees]
Therefore, for each Status display its value once. For each Team, display its value once. For each Manager, display its value once and list his/her employees.
Like this ....
[highlight #FF99FF]
Status: Accepted
Team: Human Resources
Manager: John Doe
Doe, Jane
Park, Deer
Cola, Coke
Manager: Jane Doe different Manager within Team HR
Doe, John
Deer, Park
Coke, Cola
Team: Business different Team but Status = Accepted
Manager: John Doe
Doe, Jane
Park, Deer
Cola, Coke
Status: Assigned new Status
Team: new value
Manager: new value
new value(s)
-- Repeat format until end of records in db --
[/highlight]
The code I've written outputs like this:
Status: Accepted
Team: Human Resources
Manager: Unknown
Doe, Jane
Status: Accepted
Team: To Be Determined (TBD)
Manager: Unknown
Doe, Jane
Park, Deer
Cola, Coke
Status: Assigned
Team: Business
Manager: Unknown
Jackson, Michael
Status: Assigned
Team: Business
Manager: Bird, Larry
Murphy, Eric
Status: Assigned
Team: Business
Manager: Fowler
Marino, Geronimo
However, the employees are within their respective places under the Manager. I just don't understand why the Status and Team are duplicated.
Here's a snippet of the code I've written:
Code:
....
//retrieve the data from the database
//odbc_fetch_row: Fetch a row
$currentrecord = 0; //Status
$currentrecord2 = 0; //Team
$currentrecord3 = 0; //HiringManager
while($record = odbc_fetch_array($qryresult))
if(($currentrecord == $record['ctrStatus']) && ($currentrecord2 == $record['ctrHomeTeam']) && ($currentrecord3 == $record['ctrHiringManager'])) {
echo ("<tr height=\"18\" colspan=\"3\">");
echo ("<td style=\"padding-left: 45px\">${record['Candidate']}</td>");
echo ("</tr>");
}
else {
//Status
echo ("<tr><td><br/></td></tr>");
echo ("<tr colspan=\"3\" height=\"18\"bgcolor=\"$color\">");
echo ("<td><b><u>Status: ${record['txtStatus']}</u></b><br/></td>");
echo ("</tr>");
//Team
echo ("<tr colspan=\"3\">");
echo ("<td style=\"padding-left: 20px\"><b>Functional Team: ${record['txtHomeTeam']} (${record['txtHomeTeamAbbrev']})</b><br/></td>");
echo ("</tr>");
//Hiring Manager
echo ("<tr colspan=\"3\">");
echo ("<td style=\"padding-left: 35px\"><b>Hiring Manager: ${record['HiringManager']}</b><br/></td>");
echo ("</tr>");
//Candidate
echo ("<tr colspan=\"3\">");
echo ("<td style=\"padding-left: 45px\">${record['Candidate']}</td>");
echo ("</tr>");
$currentrecord = $record['ctrStatus'];
$currentrecord2 = $record['ctrHomeTeam'];
$currentrecord3 = $record['ctrHiringManager'];
}
//disconnect the db
odbc_close($conn);
Any assistance/guidance is much appreciated.
Thanks,
Nicole