--- loncom/lonsql 2007/08/25 13:45:56 1.85 +++ loncom/lonsql 2007/08/25 19:52:11 1.86 @@ -3,7 +3,7 @@ # The LearningOnline Network # lonsql - LON TCP-MySQL-Server Daemon for handling database requests. # -# $Id: lonsql,v 1.85 2007/08/25 13:45:56 raeburn Exp $ +# $Id: lonsql,v 1.86 2007/08/25 19:52:11 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -462,6 +462,8 @@ sub make_new_child { if ($srchtype eq 'exact') { $query .= 'lastname = '.$dbh->quote($fraglast). ' AND firstname = '.$dbh->quote($fragfirst); + } elsif ($srchtype eq 'begins') { + $query .= 'lastname LIKE '.$dbh->quote($fraglast.'%').' AND firstname LIKE '.$dbh->quote($fragfirst.'%'); } else { $query .= 'lastname LIKE '.$dbh->quote('%'.$fraglast.'%').' AND firstname LIKE '.$dbh->quote('%'.$fragfirst.'%'); } @@ -472,6 +474,8 @@ sub make_new_child { ); if ($srchtype eq 'exact') { $query .= $srchfield{$srchby}.' = '.$dbh->quote($srchterm); + } elsif ($srchtype eq 'begins') { + $query .= $srchfield{$srchby}.' LIKE '.$dbh->quote($srchterm.'%'); } else { $query .= $srchfield{$srchby}.' LIKE '.$dbh->quote('%'.$srchterm.'%'); }