[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.265, Thu Apr 7 19:16:10 2005 UTC revision 1.266, Fri Apr 8 20:22:23 2005 UTC
# Line 5270  Line 5270 
5270      my($self,$fid, $tag) = @_;      my($self,$fid, $tag) = @_;
5271      my($rdbH,$relational_db_response);      my($rdbH,$relational_db_response);
5272    
     # fid has to be defined so we know what to look for  
     return () unless ($fid);  
   
5273      # tag does not have to be defined since if it is not we will get everything      # tag does not have to be defined since if it is not we will get everything
5274      if ($tag) {$tag =~ s/^\s+//; $tag =~ s/\s+$//; $tag=uc($tag)}      if ($tag) {$tag =~ s/^\s+//; $tag =~ s/\s+$//; $tag=uc($tag)}
5275    
# Line 5280  Line 5277 
5277      return () unless ($rdbH);      return () unless ($rdbH);
5278    
5279    
5280      if ($tag && ($relational_db_response = $rdbH->SQL("SELECT val,url FROM attribute WHERE ( fid = \'$fid\' and tag = \'$tag\' )")) &&      my $select;
5281              (@$relational_db_response > 0))  
5282      {      if ($fid && $tag)   {$select = "SELECT fid,tag,val,url FROM attribute WHERE ( fid = \'$fid\' and tag = \'$tag\' )"}
5283          #my @arr=@$relational_db_response;      elsif ($fid)        {$select = "SELECT fid,tag,val,url FROM attribute WHERE ( fid = \'$fid\' )"}
5284          #my $lastarray=$arr[$#arr]; # if we have several values for this tag, we just want the last one!      elsif ($tag)        {$select = "SELECT fid,tag,val,url FROM attribute WHERE ( tag = \'$tag\' )"}
5285          #return @$lastarray;      else                {$select = "SELECT fid,tag,val,url FROM attribute"}
5286          return @$relational_db_response;  
5287      }      if (($relational_db_response = $rdbH->SQL($select)) && (@$relational_db_response > 0))
     elsif (!$tag && ($relational_db_response = $rdbH->SQL("SELECT tag,val,url FROM attribute WHERE ( fid = \'$fid\' )")) &&  
             (@$relational_db_response > 0))  
5288      {      {
5289          return @$relational_db_response;          return @$relational_db_response;
5290      }      }

Legend:
Removed from v.1.265  
changed lines
  Added in v.1.266

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3