Hi All,

I have to build a search module which takes the parameter as year (ex
2007,2008 etc) ,title & subjects.

Here is the module

sub search {

          my($year,$author,$conference,$subject) = @_;
        my $sth1=$dbh->prepare("select date_upload from docs");
        my $res=$sth1->execute();
        if ($res==0){
                $result=0;
        }
#       my @records=$sth1->fetchrow_array();
#       my @date;
#       foreach my $row(@records){
#       if((index($row,$date))==0){
#       push @date,$row;
#       }

      my $sth=$databasehandle->prepare("select
title,author,s.name,file from docs d join subject s on
s.id=d.subject_id and d.author_name=$author and s.id=$subject");
        my $res = $sth->execute();

        my @results;

        while (my $array_ref1 =$sth->fetchrow_arrayref){
                 push @results,[EMAIL PROTECTED];
        }

return @results;
}

My Database is storing the date_uploaded field as date type.

I am lost , guidence in this regard is appreciated.

my subroutine should be able to search year value in date_upload field
in the docs & show me the result.
I am using  postgresql and new user of it.


my above attemp may be wrong please suggest me the any good approach
to retrieve the data.


Thanks in advance


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to