SEARCH BY SPECIES
(leave default values to see all entries)


plant fungi animal other

SEARCH BY USE/PURPOSE
(leave default values to see all entries)

plant fungi animal other



"; echo "
All Unique Species Matching Your Search Criteria


"; if ($num==0) { echo "There are no entries pertaining to your search words, please confirm spelling or try another field
"; } $i=0; while ($i < $num) { $herbtype=mysql_result($result,$i,"herbtype"); $sciname=mysql_result($result,$i,"sciname"); echo ""; echo "$herbtype : "; echo "$sciname | "; //@mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM herbreviews WHERE sciname LIKE '%{$sciname}%'"; $result2=mysql_query($query); $num2=mysql_numrows($result2); $j=0; $gstot=0; $bstot=0; while ($j < $num2) { $comname=mysql_result($result2,$j,"comname"); echo "$comname , "; $goodstars=mysql_result($result2,$j,"goodstars"); $gstot=$gstot+$goodstars; $badstars=mysql_result($result2,$j,"badstars"); $bstot=$bstot+$badstars; $j++; } if ($goodstars>=0){ $starsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/stars0.png";} if ($goodstars>=1){ $starsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/stars1.png";} if ($goodstars>=2){ $starsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/stars2.png";} if ($goodstars>=3){ $starsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/stars3.png";} if ($goodstars>=4){ $starsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/stars4.png";} if ($goodstars>=5){ $starsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/stars5.png";} if ($badstars>=0){ $bstarsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/bstars0.png";} if ($badstars>=1){ $bstarsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/bstars1.png";} if ($badstars>=2){ $bstarsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/bstars2.png";} if ($badstars>=3){ $bstarsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/bstars3.png";} if ($badstars>=4){ $bstarsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/bstars4.png";} if ($badstars>=5){ $bstarsimg = "http://eattheplanet.org/wp-content/themes/bootstrap-child/bstars5.png";} $goodstars = $gstot/$num2; //echo "$goodstars"; echo ""; $badstars = $bstot/$num2; //echo "$badstars"; echo ""; echo " $num2 entries"; echo""; $i++; } mysql_close(); ?>