Links in a table
Posted: Sat Nov 22, 2003 10:33 am
OK, this is my first post so, hello to everyone here, and thanks for this forum. im a bit of a noob to PHP, SQL and trying to learn in the time i have available so here goes. What im trying to do is simple, create a table of files available to download through a website. The only problem i have is the link doesnt work and i need help getting it to work. So who better to ask that the experts. The site is a fan site with a list of game maps, the table is populated ok, but the link? ARRGGHHH!
What can i put where the ************ are to get the download link to work? i tried the folder path but it doesnt work.
Also the code is not all mine so is there any other way to do what i want?
Thanks to all
Code: Select all
$rest = "";
$proj = "5";
$type = "7";
$sql = "SELECT D.auth,D.titl,D.dirn,D.file,D.isdi,D.refe,
P.opt as proj,T.opt as type
FROM documents as D, proj as P, type as T
WHERE D.proj like '%".$proj."%' AND
D.type like '%".$type."%' AND
D.type = T.id and D.proj = P.id".$rest."
ORDER BY D.titl".$rest;
if (($result = mysql_query("$sql"))!=0) {
echo "<TABLE BORDER=0 table width=390 cellpadding=0 cellspacing=0 class=text><tr>\n";
echo "<TR><TH>Map Name</TH><TH>Size</TH><TH>File Name</TH>\n";
while ($row = mysql_fetch_array($result))
{ echo "<TR><TD>";
echo "<A HREF=\**************"";
printCol($row,'file');
echo "">";
printCol($row,'titl');
echo "</A>";
echo "<TD>";
printCol($row,'refe');
echo "<TD>";
printCol($row,'file');
echo "<TD>"; }
echo "</table>\n";
}
else
echo "Error ".mysql_errno()." : ".mysql_error();
?>
<?php mysql_free_result($result); ?>Also the code is not all mine so is there any other way to do what i want?
Thanks to all