in reply to DBI Driven MLM

As far as I can see, you only call $sth->fetchrow_array() once, not in a loop. That means you will only ever fetch a single row. Since you disconnect before fetching the remaining rows, you get a warning that you are disconnecting while the statement handle is still active (i.e. still has rows to fetch). Either fetch all the rows, or else use $sth->finish() if you really intend to only fetch one row.