file viewer functionality to dynamic data
Posted: Tue Jan 18, 2011 5:11 am
Hello every one,
I have created a table to retrieve details dynamically.Retrieving part is okay.And all the values in the first column are hyper linked.So now i want to apply File viewer functionality to get more details of the data which a user want.I have no idea about to do that when a user click on the hyperlink.
Here is the code.......
So if anyone have some idea please do share with me..
Thanks.
I have created a table to retrieve details dynamically.Retrieving part is okay.And all the values in the first column are hyper linked.So now i want to apply File viewer functionality to get more details of the data which a user want.I have no idea about to do that when a user click on the hyperlink.
Here is the code.......
Code: Select all
$result =mysql_query("select $fieldStr from strdet where styid LIKE '%$tx%' || styname LIKE '%$tx%' || odrno ='$tx' || odrdet LIKE '%$tx%' || date LIKE '%$tx%' || merch LIKE '%$tx%' || gen LIKE '%$tx%' || taxt LIKE '%$tx%' ");
if (($result)||(mysql_errno == 0))
{
echo "<table width='100%' border='0' cellspacing='1'><tr>";
if (mysql_num_rows($result)>0)
{
//loop thru the field names to print the correct headers
$i = 0;
while ($i < mysql_num_fields($result))
{
echo "<th>". mysql_field_name($result, $i) . "</th>";
$i++;
}
echo "</tr>";
//display the data
while ($rows = mysql_fetch_assoc($result))
{
$j = 0;
foreach ($rows as $data)
{
if ($j++ <= 0)
{ echo "<tr>";
printf('<td align="center"><a href="%s">%s</a></td>', $data, $data);
}
else
{
printf('<td align="center">%s</td>', $data);
echo "</td>";
}
}
echo "</tr>";
}
}else{
echo "<td align='center'>No Results found</td></tr>";
}
echo "</table>";
}else{
echo "Error in running query :". mysql_error();
} Thanks.