sub get_thread_replies { my ($T_id, $M_id) = ($_[0], $_[1]); my $sth1 = $dbh->prepare("SELECT * FROM $vars{'poststable'} WHERE thread_id = ? AND level_id = 0 AND parent_id = ? ORDER by message_id DESC"); $sth1->execute($T_id, $M_id); $sth1->bind_col(1, \$message_id); $sth1->bind_col(2, \$parent_id); $sth1->bind_col(3, \$thread_id); $sth1->bind_col(4, \$level_id); $sth1->bind_col(5, \$name); $sth1->bind_col(6, \$email); $sth1->bind_col(7, \$location); $sth1->bind_col(8, \$icon); $sth1->bind_col(9, \$subject); $sth1->bind_col(10, \$body); $sth1->bind_col(11, \$message_url); $sth1->bind_col(12, \$message_url_title); $sth1->bind_col(13, \$datetime); $sth1->bind_col(14, \$user_icon); $sth1->bind_col(15, \$user_sig); $sth1->bind_col(16, \$reply_subject); while ( $sth1->fetch ) { print "\n"; } }