小编bha*_* Bs的帖子

DBD :: mysql :: st fetchrow_array失败:fetch()没有execute()

fetchrow_hashref 工作正常,但当我使用fetchrow_array得到以下错误.

#!/usr/bin/perl

use warnings;
use DBI;

$DB_name    = 'database';
$DB_user    = 'root';
$DB_pwd     = '';
my $dsn = 'dbi:mysql:avm:localhost:3306';

$dbh = DBI->connect($dsn,"$DB_user","$DB_pwd");

print "\nConnection error: $DBI::errstr\n\n";

$sth  = $dbh->prepare("SELECT * FROM tblmanufacturer");
$sth->execute();

while ( ($id,$name) = $sth->fetchrow_array() ) 
{
        print "$id\t\t $name \n";
}

$sth->finish();

$dbh->disconnect();
Run Code Online (Sandbox Code Playgroud)

DBD :: mysql :: st fetchrow_array失败:fetch()没有执行()

perl

7
推荐指数
2
解决办法
1万
查看次数

如何使用Perl的linux命令连接到sftp

#!/usr/local/bin/perl
use strict;
use warnings;
system("cd $PATH
/usr/bin/sftp mysite.com <<!EOF
put sample.txt
bye
!EPF");
Run Code Online (Sandbox Code Playgroud)

当我压缩应用程序时,它询问密码,如何在代码本身中传递用户/密码,

我想要的是,我的脚本不应该问密码.我想在代码本身中设置用户/密码.用户命令在sftp中不起作用如何制作它.

linux perl

2
推荐指数
1
解决办法
1万
查看次数

右联接查询返回空值记录

CREATE TABLE IF NOT EXISTS `tweets_comment_tbl` (
  `tweet_comment_id` int(12) NOT NULL AUTO_INCREMENT,
  `tweet_id` int(12) NOT NULL,
  `tweets_comment` text NOT NULL,
  `created` int(12) NOT NULL,
  `changed` int(12) NOT NULL,
  `uid` int(12) NOT NULL,
  `userip` varchar(20) NOT NULL,
  `referer` text NOT NULL,
  `status` int(2) NOT NULL DEFAULT '1',
  PRIMARY KEY (`tweet_comment_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `tweets_comment_tbl`
--

INSERT INTO `tweets_comment_tbl` (`tweet_comment_id`, `tweet_id`, `tweets_comment`, `created`, `changed`, `uid`, `userip`, `referer`, `status`) VALUES
(1, 1, 'COMMENT USER1', …
Run Code Online (Sandbox Code Playgroud)

mysql sql mysqli

1
推荐指数
1
解决办法
1624
查看次数

在Perl中,如何在不使用哈希的情况下在数组中找到重复值?

可能重复:
使用Perl检查数据数组中重复项的最有效方法是什么?

什么是在不使用哈希的情况下在数组中查找重复值的最佳方法,

@A = ("foo","baz","bar","foo","baz","foo");
Run Code Online (Sandbox Code Playgroud)

这是我的数组,如何只提取重复值,如:

foo
baz
@arr1 = (
          '2017554310',
          '2078991086',
          '2163824970',
          '2405206346',
          '2769562630',
          '2769562630',
          '3137026006',
          '3232651356',
          '3369962470',
          '3865302266',
          '4107452620',
          '4232926280',
          '5205689000',
          '5613613000',
          '6105668446',
          '6187592436',
          '6239350730',
          '6239350730',
          '7024698706',
          '7024698706',
          '7024698706',
          '7024698706',
          '7047088496',
          '7136929460',
          '7149705670',
          '7178455806',
          '7607491726',
          '7757710940',
          '8056423386',
          '8325522340',
          '8325522340',
          '8437352856',
          '8437352856',
          '8437352856',
          '9738570770'
        );
Run Code Online (Sandbox Code Playgroud)

perl

-5
推荐指数
1
解决办法
4644
查看次数

标签 统计

perl ×3

linux ×1

mysql ×1

mysqli ×1

sql ×1