--- human_health.php 2001/03/05 12:01:28 1.3 +++ human_health.php 2001/03/06 07:38:45 1.5 @@ -15,13 +15,18 @@ $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); -$sth = $dbh->prepare("select distinct type from products"); +$sth = $dbh->prepare("select type,description from prod_type"); $sth->execute(); $types[]="any"; +$type_desc[]="any"; while ($row=$sth->fetchrow_array()) { $types[]=$row[0]; + $type_desc[]=$row[1]; } -$smarty->assign("types",$types); +$smarty->assign(array( + types=>$types, + type_desc=>$type_desc + )); $sql_where=""; @@ -46,7 +51,8 @@ if (isset($search)) { - $sth = $dbh->prepare("select distinct brand,form,generic,description,type,atc,town,smpc,have_smpc from products $sql_where order by brand asc"); + $sql="select distinct brand,form,generic,description,type,atc,town,smpc,have_smpc from products $sql_where order by brand asc"; + $sth = $dbh->prepare("$sql"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $data[]=$row;