Stuff
public text v1 · immutable$sqlQuery = "SELECT DISTINCT category FROM docs ORDER BY category ASC";
$result = @mysql_query($sqlQuery);
$options = "";
$catArr = array();
while($catRow = mysql_fetch_row($result))
{
$options .= "<option>" . $catRow[0] . "</option>";
array_push($catArr, $catRow[0]);
}
if($_REQUEST['cat'])
{
if(!in_array($_REQUEST['cat'], $catArr))
die("Invalid Category.");
$sqlQ = "SELECT * FROM docs WHERE category='".$_REQUEST['cat']."'";
$cat = $_REQUEST['cat'];
}