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