get the value of hyperlink and display details
Posted: Sun Jan 09, 2011 11:05 pm
iam displaying list of details of employees from database... which displays limited data on the first page. I have created a hyperlink to the employee name. when user clicks on the particular employee name, it will displays all the details of the corresponding employee... Kindly know me how to figure this out. Below is the code wat i have done.Kindly suggest.
Code: Select all
<?php
$user_name = "root";
$pass_word = "";
$database = "testbase";
$server = "localhost";
$db_handle = mysql_connect($server, $user_name, $pass_word,$database);
$db_found = mysql_select_db($database, $db_handle);
$SQL = "select * from expenses";
$result = mysql_query($SQL);
?>
<?php
for ($j=0; $j<count($result);$j++) {
$db_field=$result[$j][1];
$cssClass = ($j%2) ? 'even' : 'odd'; ?>
<?php
while ($db_field = mysql_fetch_assoc($result))
{
?>
<tr class="<?php echo $cssClass;?>" >
<td class="center">
</td>
<td align="center" >
<?php echo $db_field['fromloc'] ?>
</td>
<td align="center">
<a href="http://www.google.com"><?php echo $db_field['toloc'] ?></a>
</td>
<td align="center">
<?php echo $db_field['travelmode'] ?>
</td>
<td align="center">
<?php echo $db_field['travelstartdate'] ?>
</td>
<td align="center">
<?php echo $db_field['travelenddate'] ?>
</td>
<td align="center">
<?php echo $db_field['costcenter'] ?>
</td>
<td align="center">
<?php echo $db_field['project'] ?>
</td>
<td align="center">
<?php echo $db_field['purpose']?>
</td>
<td align="center">
<?php echo $db_field['currency'] ?>
</td>
<!-- <td align="center">
<?php echo $db_field['paymenttype']?>
</td> -->
<td align="center">
<?php echo $db_field['advancerequirement']?>
</td>
</tr>
<?php