$k = 0; while (@results = $sth->fetchrow_array()) { $data[$k] = [ @results ]; $k++; }