Grammar and Usage: Hall of Shame

$value)
$$key = $value;
if ($categreq)
{
$ordby = “category”;
if ($categreq == “all”) $bleep = “”;
else $bleep = “WHERE category = ‘$categreq’ ” ;
$query = “SELECT * FROM grammar $bleep ORDER BY category, item”;
}
if ($family)
{
$ordby = “family”;
if ($family == “all”) $bleep = “”;
else $bleep = “WHERE family = ‘$family’ ” ;
$query = “SELECT * FROM grammar $bleep ORDER BY family, item”;
}
$result = mysql_db_query($dbName,$query) or die(mysql_error()) ;
$oldcat = “”;
$oldfam = “”;
if ($myrow = mysql_fetch_array($result))
{
do {
$numkey = $myrow[0] ;
$famnow = $myrow[1];
$catnow = $myrow[2];
$item = $myrow[3] ;
$contrib = $myrow[4] ;
$explan = $myrow[5] ;
if ($ordby == “category”)
{
if ($catnow != $oldcat)
{
echo “

$catnow words

” ;
$oldcat = $catnow;
}
}
if ($contrib) $narf = “
Nominated by $contrib“;
else $narf = “”;
if (!get_magic_quotes_runtime())
{
$item = stripslashes($item);
$contrib = stripslashes($contrib);
$explan = stripslashes($explan);
}
if ($showex == “Y”)
{
echo “$item
$narf

” ;
echo “$explan


” ;
}
else
{
echo “$item
” ;
}
}
while ($myrow = mysql_fetch_array($result));
} else { echo “Sorry, no records were found!”; }
?>

to main Grammar page

Last Reviewed: 2 months