954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

view employee info for the employee selected from the drop down list

i have designed an employee details webpage. there is an option of generating pay slip. to do so all the information related to the employee and his/her salary has to be entered.

the employee details are already stored in the database. i want to design a form that will have a drop down list holding the employee names and some textboxes to hold the related information of the employee.

i want that when a employee name will be selected, the information related to that employee will be displayed in the respective textboxes.

please give a quick reaply with a code example.

thank you

fariba123
Newbie Poster
2 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

You could use something like this;


Employee 1Employee 2Employee 3<?php
$employee_selected=$_REQUEST['employee_name'];

$query="SELECT * FROM employees WHERE employee='$employee_selected'";

$result=mysql_query($query);

$row=mysql_fetch_array($result, MYSQL_ASSOC);

// THEN YOU NEED THE TEXT BOXES

echo '';
?>

This script will get the employee name from the drop down, search the database and display the details you require in the respective textboxes.

I have a Customer/Employee management system on my website you could purchase if your stuck! I can totally customise it for you!

phper
Posting Whiz in Training
213 posts since Nov 2006
Reputation Points: 22
Solved Threads: 19
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You