restrict viewing by status
Posted: Sun Feb 15, 2004 4:02 pm
i have a table set up wich gets data from mysql database it has 5 columns and i want to restrict viewing of the 5th column only to certain users ive created a goup called power user how can i let everyone view the 1st 4 columns and power user to view all 5 here is part of the code
the columns i want to restrict are comented out
thanks
Code: Select all
$query = "SELECT * FROM uk_numberones WHERE `year` = '$year'";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
echo "<table width='100%' border='1' cellpadding='2' cellspacing='2' bordercolor='#006699' align='center'>";
echo "<tr>";
echo "<td width='100%' background='./templates/fisubsilversh/images/cellpic3.gif'><div align='center' class='style2 style3'><strong>
Number 1 Singles from $year </strong></div></td>";
echo "</tr>";
echo "</table>";
echo "<table width='100%' border='1' cellpadding='2' cellspacing='2' bordercolor='#006699' align='center'>";
echo "<td width='13%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Date</div></td>";
echo "<td width='33%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Artist</div></td>";
echo "<td width='39%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Title</div></td>";
echo "<td width='6%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Wks</div></td>";
//echo "<td width='9%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Download</div></td>";
while($row = mysql_fetch_array($result))
{
echo "<tr><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[date]</div></td></tc>";
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[artist]</div></td></tc>";
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[title]</div></td></tc>";
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[wks1]</div></td></tc>";
//echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'><a href="$row[dllink]"><img src='./templates/fisubsilversh/images/icon_download.gif'></a></div></td></tr>";
}
echo "</table>";thanks