I'd like to know where you got the code you posted. That will not do what you want it to do. In fact, I don't think you can do what you want to do, if I'm understanding you correctly.
If you want to get the records that a user has added, you need to change
$in{$db_cols[$db_key]} = $db_key;
to
$in{$db_cols[$auth_user_field]} = $db_userid;
Also, you don't need the first line you have -- my (%rec) = @_;
You didn't include the part of your code which displays the variables.
This is what you cannot do, if I understand you correctly. Users must log in so the script will know which records to retrieve.
JPD
If you want to get the records that a user has added, you need to change
$in{$db_cols[$db_key]} = $db_key;
to
$in{$db_cols[$auth_user_field]} = $db_userid;
Also, you don't need the first line you have -- my (%rec) = @_;
You didn't include the part of your code which displays the variables.
This is what you cannot do, if I understand you correctly. Users must log in so the script will know which records to retrieve.
JPD