in reply to Referencing MySQL Results by Column

I believe others have already given appropriate Perl advice. However, if you prefer not to select all rows from the table, which may make or may not make sense depending on the size of the table, you can use a for loop to build a list of user names, and then structure your SQL select statement to use "IN".

$sqlQuery = "SELECT username,email,phone FROM users where username IN +("name1", "name2", ...)"; $sqlResult = $connect->query($sqlQuery);

This should return all the rows you need and then you can process them as needed within your program.

NOTE: I know the "IN" list capability exists in Oracle, so my suggestion is based on the assumption of similar functionality in MySQL.