I want to display the data in a table in Database to be displayed as a link with it containing a downloadable report. I have put the code but it is giving an error. Can anyone tell me where is the problem? My code is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<?php
include("config.php");
///////////////////////////////////////////////
$result = mysql_query("SELECT * FROM data");
?>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="36%" height="95"> </td>
<td width="64%"> </td>
</tr>
<tr>
<td height="279"> </td>
<td valign="top">
<?php
while($cat = mysql_fetch_assoc($result)){
echo "<a href='reports/."$cat['contents']"'. target='_blank'>".$cat["contents"].' '.$cat["dt"].'</a>';
}
?>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
I'm facing problem in linking file name stored on my server and its name stored in "contents" column of table "data" because it will be different for every file.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<?php
include("config.php");
///////////////////////////////////////////////
$result = mysql_query("SELECT * FROM data");
?>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="36%" height="95"> </td>
<td width="64%"> </td>
</tr>
<tr>
<td height="279"> </td>
<td valign="top">
<?php
while($cat = mysql_fetch_assoc($result)){
echo "<a href='reports/."$cat['contents']"'. target='_blank'>".$cat["contents"].' '.$cat["dt"].'</a>';
}
?>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
I'm facing problem in linking file name stored on my server and its name stored in "contents" column of table "data" because it will be different for every file.