PDA

View Full Version : employee directory--HELP?


slimrob
03-15-2007, 08:47 AM
Hi Guys,
I'm trying to create an employee directory on the intranet that I update. Something simple, but professional. I want you to be able to click on a letter and have the page list everyone's last name that starts with that letter, or have the ability to search for a specific last name. The data will be a .csv extract from our HR system. Do you guys know of a product or form or anything that is capable of doing this? Thanks for any help you guys can provide. If this post is in the wrong area, please let me know where it should be. Thanks.

adamcube
03-17-2007, 09:05 AM
Hey Slimrob,

I'd say you'd be looking to pop the .csv into a database of sorts, I'd recommend MySQL. You would then have to use a server-side language, such as PHP, to query your database and draw up a table with the last names, ect. It's not all that difficult to do in truth.

In the PHP, something like...


$query = mysql_query("SELECT * FROM `employees` WHERE `last_name` = 'M'");
$query_num = mysql_num_rows($query);

echo "<ul>";

for ($i=0; $i < $query_num; $i++) {

$last_name = mysql_result($query, $i, 'last_name');
echo "<li>$last_name</li>";

}

echo "</ul>";


...would query this MySQL database for all last names in the employees table beginning with M, and then run a loop to display them in a list format.

I would research the functions and languages I've mentioned in this post, and hopefully you'll be able to get started with something.

Adam

scoutt
03-24-2007, 02:34 PM
so like this

http://www.snippetlibrary.com/tutorials/tutorials.php/2/16/257