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();
In reply to Re^3: fetch all data
by poj
in thread fetch all data
by bigup401
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |