in reply to Re^2: fetch all data
in thread fetch all data
my $sth = $DBH->prepare(' SELECT DISTINCT AGE FROM USERS WHERE NAMES = ?'); $sth->execute('John'); my $records = $sth->fetchall_arrayref; for my $record (@$records){ printf "%d\n", $record->[0]; # AGE field }
If that doesn't work try the same code without the WHERE statement.
pojmy $sth = $DBH->prepare(' SELECT DISTINCT AGE FROM USER'); $sth->execute();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: fetch all data
by stevieb (Canon) on Mar 17, 2019 at 16:24 UTC | |
|
Re^4: fetch all data
by bigup401 (Pilgrim) on Mar 17, 2019 at 18:04 UTC | |
by poj (Abbot) on Mar 17, 2019 at 18:23 UTC | |
by bigup401 (Pilgrim) on Mar 17, 2019 at 20:03 UTC | |
by davido (Cardinal) on Mar 18, 2019 at 15:02 UTC | |
by marto (Cardinal) on Mar 18, 2019 at 09:21 UTC |