added search to asset manager
This commit is contained in:
parent
a99dea8129
commit
74b01f732e
5 changed files with 265 additions and 149 deletions
|
|
@ -135,7 +135,7 @@ Builds a hash of data from a series of rows.
|
|||
|
||||
=head3 sql
|
||||
|
||||
An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by a colon ":" to form a complex key.
|
||||
An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by a colon ":" to form a complex key. If the query selects only one column, then the key and value will be the same.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -147,7 +147,8 @@ sub buildHash {
|
|||
$sth = $self->read($sql);
|
||||
while (@data = $sth->array) {
|
||||
my $value = pop @data;
|
||||
my $key = join(":",@data);
|
||||
my $key = join(":",@data); # if more than two columns is selected, join them together with :
|
||||
$key = $value unless ($key); # if only one column is selected, then it is both the key and the value
|
||||
$hash{$key} = $value;
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -163,7 +164,7 @@ Builds a hash reference of data from a series of rows.
|
|||
|
||||
=head3 sql
|
||||
|
||||
An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by an underscore "_" to form a complex key.
|
||||
An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by a colon ":" to form a complex key. If the query selects only one column, then the key and the value will be the same.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue