January 2002
Intermediate to advanced
288 pages
8h 45m
English
sqlSelectHashref — returns a reference to a hash for a single row of results from a SQL statement
my $hashref = $slashdb->sqlSelectHashref($select); my $hashref = $slashdb->sqlSelectHashref($select, $from); my $hashref = $slashdb->sqlSelectHashref($select, $from, $where); my $hashref = $slashdb->sqlSelectHashref($select, $from, $where, $other);
sqlSelectHashref constructs and executes a SQL
statement from its parameters. If the execution succeeds, it returns a
reference to a hash for the first row of results. The hash keys are the field
names, and the values are the field values. This function takes the same
parameters as sqlSelect and handles errors in the same way.
my $user = $selfdb->sqlSelectHashref('*', 'users', "uid=$uid");
print "Username: $user->{nickname}, homepage: $user->{homepage}\n";Read now
Unlock full access