HOW TO KNOW WHICH NAME THE USER HAS CLICKED

A

Anonymous

Guest
Hi

I am new to PHP !!

I can read data base and display the Employee Names on a web page.

Now I want
1. User to click on an employee name say "Andre'
2. and a new page should open up display the employee details of 'Andre' or the employee name on which the user has clicked.


Please help me ..it is very very urgnt.

I am confused as how do i get the employee name on which the user has clicked.

With regards
Vikas AThavale
vikaspa@vsnl.com
 
To reach what you want you'll need to display those names from a database query as links:

Code:
$sql="SELECT * FROM ".$table." ORDER BY name DESC";
$result=mysql_query($sql,$db);

//output the result
if(!isset($id)){
        while ($row=mysql_fetch_array($result)){
	echo "<table width='100%'><tr><td>";
	echo "name: <a href='employees.php?id=".$row["id"]."'>".$row["name"]."</a>";
	echo "</td></tr></table>";
        }
}

if (isset($id)){
        while ($row=mysql_fetch_array($result)){
	echo "<table width='100%'><tr><td>";
	echo "name: ".$row["name"]."";
	echo "</td><td>age: ".$row["age"]."";
                and so on.....
                 echo "</tr></table>";
        }
}
That's it I think
:)
 
Back
Top