frank1 has asked for the wisdom of the Perl Monks concerning the following question:
Am having a problem with selecting users emails
this is my DB
my tryDB USERS ID USERID EMAIL 1 XD4555 JOHNE@DEO.COM 2 JJKKKK JANE@DEO.COM 3 JJKKKK JANE21@DEO.COM FUSERS ID USERID USERID_IM 1 XD4555 JJKKKK 2 JJKKKK TYYUPPO
my $AID = "XD4555"; my $query = $dbh->prepare("SELECT snd.EMAIL FROM FUSERS as m JOIN USERS as snd ON snd.USERID = m.USERID WHERE (m.USERID_IM = ?)"); $query->execute($AID); my $user1 = $query->fetchall_arrayref(); my $query_other = $dbh->prepare("SELECT snd.EMAIL FROM FUSERS as m JOIN USERS as snd ON snd.USERID = m.USERID_IM WHERE (m.USERID = ?)"); $query_other->execute($AID); my $user2 = $query_other->fetchall_arrayref(); my $TotalEmails = $user1 + $user2; foreach my $em ( $TotalEmails ) { my $rez = join( ",", $em); print "$rez\n"; }
now this is the results am getting, its random generated
189822522692296
this is the output i expect
email@email.com, email@email.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Selecting DB
by Corion (Patriarch) on Jul 08, 2023 at 12:57 UTC | |
by frank1 (Monk) on Jul 08, 2023 at 13:11 UTC | |
by Corion (Patriarch) on Jul 08, 2023 at 13:24 UTC | |
by frank1 (Monk) on Jul 08, 2023 at 14:20 UTC | |
by frank1 (Monk) on Jul 08, 2023 at 14:53 UTC | |
by NetWallah (Canon) on Jul 08, 2023 at 15:50 UTC | |
| |
|
Re: Selecting DB
by cavac (Prior) on Jul 10, 2023 at 12:19 UTC | |
|
Re: Selecting DB
by Anonymous Monk on Jul 08, 2023 at 12:59 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |