Adding a column which creates a number (104) based upon date created

Hi,

I have an HTML table with extracted data from a MySQL table and I still need to figure out one more thing.

What I have is a set of scores uploaded via an application into the DB, and I want to have a column based on when they were created (earliest to latest) which adds a 1-4 into that column. I already have a column which captures the date created, so I am hoping this will be fairly easy. I want the 1-4 to start over whenever there is a different four letters in the employee_id column, so it would order 1-4 for someone with an employee ID of ADEC, and then start over 1-4, with an employeeID of ADKI.

to help better understand here is the code I have thus far. Everything work well, just need to add the extra column with data I mention above.


[COLOR=#000000][COLOR=#007700]<[/COLOR][COLOR=#0000BB]html[/COLOR][COLOR=#007700]>
<![/COLOR][COLOR=#0000BB]DOCTYPE HTML [/COLOR][COLOR=#007700]PUBLIC [/COLOR][COLOR=#DD0000]"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"[/COLOR][COLOR=#007700]>
<[/COLOR][COLOR=#0000BB]html[/COLOR][COLOR=#007700]>
<[/COLOR][COLOR=#0000BB]head[/COLOR][COLOR=#007700]>
<[/COLOR][COLOR=#0000BB]title[/COLOR][COLOR=#007700]>[/COLOR][COLOR=#0000BB]Scores[/COLOR][COLOR=#007700]</[/COLOR][COLOR=#0000BB]title[/COLOR][COLOR=#007700]>
<[/COLOR][COLOR=#0000BB]link href[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"report.css" [/COLOR][COLOR=#0000BB]rel[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"stylesheet" [/COLOR][COLOR=#0000BB]type[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"text/css" [/COLOR][COLOR=#007700]/>
<[/COLOR][COLOR=#0000BB]meta http[/COLOR][COLOR=#007700]-[/COLOR][COLOR=#0000BB]equiv[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"Content-Type" [/COLOR][COLOR=#0000BB]content[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"text/html; charset=ISO-8859-1"[/COLOR][COLOR=#007700]>
</[/COLOR][COLOR=#0000BB]head[/COLOR][COLOR=#007700]>
<[/COLOR][COLOR=#0000BB]body[/COLOR][COLOR=#007700]>
<?[/COLOR][COLOR=#0000BB]php
$con [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_connect[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"localhost"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#DD0000]"username"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#DD0000]"pw"[/COLOR][COLOR=#007700]);
if (![/COLOR][COLOR=#0000BB]$con[/COLOR][COLOR=#007700])
  {
  die([/COLOR][COLOR=#DD0000]'Could not connect: ' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]mysql_error[/COLOR][COLOR=#007700]());
  }

[/COLOR][COLOR=#0000BB]mysql_select_db[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"nnprinceton_p1"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$con[/COLOR][COLOR=#007700]);


[/COLOR][COLOR=#0000BB]$result [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"SELECT * 
			FROM tablename ORDER BY employee_id"[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]	[/COLOR][COLOR=#0000BB]	[/COLOR][COLOR=#0000BB]	

echo [/COLOR][COLOR=#DD0000]"<table>
<tr>
<th>Score ID</th>
<th>Employee ID</th>
<th>Employee Name</th>
<th>score 1</th>
<th>score 2</th>
<th>score 3</th>
<th>score 4</th>
<th>score 5</th>
<th>score 6</th>
<th>Assessor Name</th>
<th>Assessor ID</th>
<th>Call Number (1-4)</th>
<th>Date Created</th>
<th>Date Uploaded</th>
</tr>"[/COLOR][COLOR=#007700];


while([/COLOR][COLOR=#0000BB]$row [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]mysql_fetch_array[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$result[/COLOR][COLOR=#007700]))
  {
  echo [/COLOR][COLOR=#DD0000]"<tr>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'score_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'employee_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'employee_name'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'score1'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'score2'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'score3'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'score4'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'score5'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'score6'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'assessor_name'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'assessor_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'Need code to increment 1-4 based on date_created and employee_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'date_created'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"<td>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$row[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'date_uploaded'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"</td>"[/COLOR][COLOR=#007700];
  echo [/COLOR][COLOR=#DD0000]"</tr>"[/COLOR][COLOR=#007700];
  }
echo [/COLOR][COLOR=#DD0000]"</table>"[/COLOR][COLOR=#007700];

[/COLOR][COLOR=#0000BB]mysql_close[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$con[/COLOR][COLOR=#007700]);

[/COLOR][COLOR=#0000BB]?>
[/COLOR]</body>
</html>

[/COLOR]