Front page | perl.beginners |
Postings from March 2002
Re: &&
Thread Previous
|
Thread Next
From:
MarcusWillemsen
Date:
March 28, 2002 07:45
Subject:
Re: &&
Message ID:
25a4729abe.29abe25a47@compuserve.de
Hi Chas,
thanks for your reply.
The code was the simplified code of a subroutine (below). The Data
originates from a Webformula and is passed on to the Subroutine like
snippet
&extract_data(@datum, @seminare, @staedte);
..
..
..
sub extract_data {
my $dates = shift;
my $themes = shift;
my $cities = shift;
my @dates = split /\s+/, "$dates";
my @themes = split /\s+/, "$themes";
my @cities = split /\s+/, "$cities";
if(@dates && !@themes && !@cities) {
my $date_count = @dates;
if($date_count > 1) {
$sth_between = $dbh->prepare( qq{SELECT * FROM termine
WHERE beginn BETWEEN ? and ?});
$sth_between->execute($dates[0],$dates[1]);
my $result = $sth_between->fetchrow_hashref();
if($result){
print $form->p("$result->{beginn}");
#print out rest of fields
}
}
else {
$sth_exact = $dbh->prepare(qq {SELECT * FROM termine WHERE
beginn < ? ORDER BY beginn ASC});
$sth_exact->execute($dates[0]);
my $result = $sth_exact->fetchrow_hashref();
if($result){
while($result){
print $form->p("$result->{beginn}");
#print out rest of fields
}
}
else{
print $form->p("Tut mir leid nichts gefunden");
}
}
}
#here should be all the other if else loop seven in total each printing
#out search results depending on which array or which combination of
#arrays contains data
}
Marcus
Thread Previous
|
Thread Next
-
&&
by MarcusWillemsen
-
Re: &&
by MarcusWillemsen
-
RE: &&
by Nikola Janceski
-
RE: &&
by Nikola Janceski
-
RE: &&
by Nikola Janceski
-
Re: &&
by Chas Owens