| ||
|---|---|---|
| ID | Last Name | First Name |
| King | Steven | |
| Kochhar | Neena | |
| De Haan | Lex | |
| Hunold | Alexander | |
| Ernst | Bruce | |
| Austin | David | |
| Lorentz | Diana | |
| Greenberg | Nancy | |
| Faviet | Daniel | |
| Chen_sui | John | |
| Sciarra | Ismael | |
| Popp | Luis | |
| Raphaely | Den | |
| Khoo | Alexander | |
| Baida | Shelli | |
| Tobias | Sigal | |
| Himuro | Guy | |
| Colmenares | Karen | |
| Weiss | Matthew | |
| Fripp | Adam | |
| Kaufling | Payam | |
| Vollman | Shanta | |
| Mourgos | Kevin | |
| Nayer | Julia | |
| Mikkilineni | Irene | |
| Landry | James | |
| Markle | Steven | |
| Bissot | Laura | |
| Atkinson | Mozhe | |
| Marlow | James | |
| Olson | TJ | |
| Mallin | Jason | |
| Rogers | Michael | |
| Gee | Ki | |
| Philtanker | Hazel | |
| Ladwig | Renske | |
| Stiles | Stephen | |
| Seo | John | |
| Patel | Joshua | |
| Rajs | Trenna | |
| Davies | Curtis | |
| Matos | Randall | |
| Vargas | Peter | |
| Russell | John | |
| Partners | Karen | |
| Errazuriz | Alberto | |
| Cambrault | Gerald | |
| Zlotkey | Eleni | |
| Tucker | Peter | |
| Bernstein | David | |
| Hall | Peter | |
| Olsen | Christopher | |
| Cambrault | Nanette | |
| Tuvault | Oliver | |
| King | Janette | |
| Sully | Patrick | |
| McEwen | Allan | |
| Smith | Lindsey | |
| Doran | Louise | |
| Sewall | Sarath | |
| Vishney | Clara | |
| Greene | Danielle | |
| Marvins | Mattea | |
| Lee | David | |
| Ande | Sundar | |
| Banda | Amit | |
| Ozer | Lisa | |
| Bloom | Harrison | |
| Fox | Tayler | |
| Smith | William | |
| Bates | Elizabeth | |
| Kumar | Sundita | |
| Abel | Ellen | |
| Hutton | Alyssa | |
| Taylor | Jonathon | |
| Livingston | Jack | |
| Grant | Kimberely | |
| Johnson | Charles | |
| Taylor | Winston | |
| Fleaur | Jean | |
| Sullivan | Martha | |
| Geoni | Girard | |
| Sarchand | Nandita | |
| Bull | Alexis | |
| Dellinger | Julia | |
| Cabrio | Anthony | |
| Chung | Kelly | |
| Dilly | Jennifer | |
| Gates | Timothy | |
| Perkins | Randall | |
| Bell | Sarah | |
| Everett | Britney | |
| McCain | Samuel | |
| Jones | Vance | |
| Walsh | Alana | |
| Feeney | Kevin | |
| OConnell | Donald | |
| Grant | Douglas | |
| Whalen | Jennifer | |
| Hartstein | Michael | |
| Fay | Pat | |
| Mavris | Susan | |
| Baer | Hermann | |
| Higgins | Shelley | |
| Gietz | William | |
| Pataballa | Valli | |
| Pataballa | Valli | |
// --------------------------------------------------------
// the code
// --------------------------------------------------------
<div id="leftsidebar">
<br>
<br>
To ADD a new employee
<br>
select any employee
<br>
and overwrite its data.
<br>
<br>
To modify or delete an
<br>
employee, click on its
<br>
ID then choose the
<br>
appropriate action
<br>
<br>
<br>
</div>
<?php
include 'common.php';
$link = db_connect();
echo "<div>";
// --- select employee fields for display ---
$query = 'SELECT employee_id, last_name, first_name FROM emp_php ORDER BY employee_id';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// -----------------------------------------------------------------------
// display employees in a table with the first column selectable
// selecting an employee goes to an add, modify, or delete choice
// -----------------------------------------------------------------------
echo "<div id='results'>";
echo "<table id='emp' border='1' >\n";
echo "<thead>";
echo "<TR><TH COLSPAN=\"3\"><H3><BR>employees</H3></TH>";
echo "<tr><th>ID</th><th>Last Name</th><th>First Name</th></tr>";
echo "</thead>";
while ($row = mysql_fetch_array($result, MYSQL_BOTH))
{
echo "<tr>";
$id = $row[0];
$ln = $row[1];
$fn = $row[2];
echo " <td><input type=\"button\" value=\"$id\" class=\"sel\"
onmouseover=\"mouseover(this)\"
onmouseout=\"mouseout(this)\"
onclick=\"rowsel(this.value)\">
</td>";
echo " <td>$ln</td>";
echo " <td>$fn</td>";
echo "</tr>";
}
echo "</table>\n";
echo "</div>";
// --- Free resultset, Close Connection ---
mysql_free_result($result);
mysql_close($link);
echo "</div>";