Name
sqlSelectArrayRef — returns one row as an array reference from an executed SQL statement
Synopsis
my $arrref = $slashdb->sqlSelectArrayRef($select); my $arrref = $slashdb->sqlSelectArrayRef($select, $from); my $arrref = $slashdb->sqlSelectArrayRef($select, $from, $where); my $arrref = $slashdb->sqlSelectArrayRef($select, $from, $where, $other);
sqlSelectArrayRef
constructs and executes a SQL
statement from its parameters. It takes the same parameters as
sqlSelect
and handles failures in the same way. If it
succeeds, it returns a reference to an array of the fields of the first row
selected from the database.
Example
my $userref = $slashdb->sqlSelectArrayRef('nickname, realemail', 'users', "uid=$uid"); print "Username: $userref->[0], address: $userref->[1]\n";
Get Running Weblogs with Slash now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.