--- animal_health.php 2001/03/05 12:01:28 1.2 +++ animal_health.php 2001/04/05 12:26:33 1.6 @@ -60,7 +60,7 @@ if (isset($search) && $search!="" && $search!="all") { $sql_where[]=" (upper(brand) like upper('%$search%') or upper(form) like upper('%$search%') or - upper(generic) like upper('%$search%') or + upper(composition) like upper('%$search%') or upper(description) like upper('%$search%') ) "; } @@ -71,11 +71,11 @@ if (isset($search)) { - $sth = $dbh->prepare("select distinct brand,form,composition,description,type,smpc from vet_products $sql_where"); + $sth = $dbh->prepare("select distinct brand,form,composition,description,type,smpc,have_smpc from vet_products $sql_where order by brand asc"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { if ($show_animals) { - $sth2 = $dbh->prepare("select vet_animal_product.animal,name from vet_animal_product,vet_animal where vet_animal_product.animal=vet_animal.animal and smpc=$row[smpc] order by brand asc"); + $sth2 = $dbh->prepare("select distinct vet_animal_product.animal,name from vet_animal_product,vet_animal where vet_animal_product.animal=vet_animal.animal and smpc=$row[smpc]"); $sth2->execute(); unset($animals); while ($row2=$sth2->fetchrow_hash()) {