I am trying to perform an SQL queary inside a while loop that uses previous quearied data with DBI. I am returning only the first result, I am pretty certain it's because I'm overwriting $sth->fetchrow_array().
Or, it might be because you're overwriting $sth when you prepare a new query inside the loop.