$sth= $dbh->prepare( "SELECT * FROM user_items WHERE indexnum = $value"); $sth->execute(); $sth->bind_col( 2, \$val1); $sth->bind_col( 3, \$val2); $sth->bind_col( 4, \$val3); while($sth->fetch) { print "$val1, $val2, $val3\n"; }