On 19 Dec 2002, chad kellerman wrote:

>   I sure it has got to be something so simply that I am just over
> looking.  It just seems that what I am doing now is just too much work
> to grab a variable:
>
>  $sth = $dbh->prepare( q{
>               SELECT dailypath, hostname FROM tblProcess
>               WHERE hostId = ?
>                      } );
>         $sth->execute ( 543 );
>       $sth->bind_columns( \$dailypath, \$hostname  );
>         while ( $sth->fetchrow_array () ) {
>                 push @dailypath, $dailypath;
>               push @hostname, $hostname;
>         }
>         $sth->finish ();

Try this:

my $sth = $dbh->prepare('select dailypath, hostname from tblProcess where hostId = ?');
$sth->execute(543);
my ($dailypath, $hostname) = $sth->fetchrow_array();

You may have to add $sth->finish() if hostId doesn't refer to a unique
column and you don't reuse $sth for a while in your program.

- D

<[EMAIL PROTECTED]>

Reply via email to