$sth->execute($content_page, $content_type);
while (@content = $sth->fetchrow_array) {
        #do something with @content
}
$dbh->disconnect();


Scott Phelps wrote:

> Here's what doesn't work:
> 
> my $dbh=DBI->connect('dbi:ODBC:scottp', 'user', 'pass',
>               {RaiseError => 1,
>               AutoCommit => 1}
>               ) || errorhandler("Database connection error: $DBI::errstr");
> 
> $sth=$dbh->prepare("SELECT $content_field FROM $content_table WHERE page= ?
> AND type= ?");
> $sth->execute($content_page, $content_type);
> @content = $sth->fetchrow_array;
> $dbh->disconnect();
> 
> This of course returns an array (actually only one element) of the first row
> that satisfies my SQL statement.
> Is there a way to get the specific field of multiple rows that match my
> criteria into an array?
> 
> ______________________________________
> splehP ttocS
> rotartsinimdA smetsyS TN
> secivreS tenretnI renroKbeW
> moc.renrokbew@pttocs
> moc.renrokbew.www
> 
> $a="@ARGV";while($a){$a=~s/(.$)//;$b=$b.$1;}print "$b\n";
> ______________________________________


-- 
   Simon Oliver

---------------------------------------
   Department of Biomolecular Sciences
   UMIST, PO Box 88, Sackville St
   Manchester, M60 1QD
   United Kingdom

   Phone:  +44 161 200 8912
   Fax:    +44 161 236 0409
   Mobile: +44 776 183 0327
   Email:  [EMAIL PROTECTED]
---------------------------------------

Reply via email to