Re: Problems connecting

"A. Gerow" <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Organization PLU
Message-ID <[email protected]>
I'm pretty sure one can fetch only the first couple rows in a return-set 
and still be ok.
The general idea is:
    $dbh-> connect(...)

    $sth=$dbh->prepare(sql_stmt)
    $sth->execute()
    $sth->fetch() # different for different kinds of returns.
    $sth->finish() # Are you missing this?
    ...

    $dbh->disconnect() # Your error.

Martin J. Evans wrote:
> The error "disconnect invalidates 1 active statement handle" implies
> you have an active statement for which all results have not been fetched
> when you call disconnect. e.g.
>
> prepare(some sql)
> execute
> fetch one row when there are 20 rows
>   
Right here one should call $sth->finish()
> disconnect (or script terminates)
>
> As the error states, if you don't fetch all the results from a select
> then call finish first or fetch all the results.
>
> I cannot tell from your description how "this works on one server"
> and not another.
>
> Martin
>   

-- 
Aaron Gerow
Open Source Developer
Digital Media - Information and Technology Services
Pacific Lutheran University
Tacoma, Washington


-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.