OSDN Git Service

fix class name and use
authorISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Tue, 6 Nov 2012 10:08:19 +0000 (19:08 +0900)
committerISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Tue, 6 Nov 2012 10:08:19 +0000 (19:08 +0900)
missing binding param

lib/Mubot4FB/DB/TweetMap.pm

index 9108c9e..eba132b 100644 (file)
@@ -3,10 +3,11 @@
 # Copyright (c) 2012 ISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
 # This program is covered by the GNU General Public License 2
 #
-package Mubot4FB::DB::Tweet;
+package Mubot4FB::DB::TweetMap;
 use strict;
 use utf8;
 
+use DBI qw/:sql_types/;
 use base 'Mubot4FB::DB';
 
 use Data::Dumper;
@@ -26,6 +27,7 @@ sub add_map {
 sub search_by_key_id {
        my ($me, $db_args) = @_;
        my $sth = $me->{dbh}->prepare("select * from tweet_map where key_id = ?");
+       $sth->bind_param(1, $db_args->{key_id}, SQL_BIGINT);
        my $rv = $sth->execute();
 
        my $ret = $sth->fetchrow_hashref();
@@ -53,3 +55,5 @@ sub delete_map_by_key_id {
        $sth->finish;
        return $rv;
 }
+
+1;