- 论坛徽章:
- 0
|
本帖最后由 aef25u 于 2011-03-04 17:12 编辑
回复 13# mitmax - while ( $sth->fetchrow_array ) {
- $str .= { Type => "$Type", Ip => "$Monitor_Ipaddress", Name => "$ProjectName" } . ",";
- }
- ......
- template 'Mysqldatabase' => { Mysql =>[$str], head => 'use DBI' };
复制代码 以上有错,你试试这样行不行,以下代码未经测试(自已注意将{}补齐):- my @srt;
- while ( my @row_ary = $sth->fetchrow_array ) {
-
- push @srt,{ Type => $row_ary[2], Ip => $row_ary[3], Name => $row_ary[4]} ;
- #或push @srt,{ Type => "$Type", Ip => "$Monitor_Ipaddress", Name => "$ProjectName" } ;
- }
- ......
- #$re_srt做MysqlQuery()的返回值
- my $re_srt=\@srt;
- ......
-
- template 'Mysqldatabase' => { Mysql =>$status, head => 'use DBI' };
-
复制代码 |
|