View Single Post
  #1  
Old 10-19-2020, 11:32 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default Need help pulling data from DB (Perl DBI)

I am pretty sure DBI is connecting but not pulling anything from DB could anyone take a look at this?

Code:
  

sub EVENT_SAY 

{

  if ($text =~/read/i)
        {        
        
        ### Read from DB
        #if(!$connect){ $connect = plugin::LoadMysql(); }
 
        $connect = plugin::LoadMysql();
        $query = "SELECT
        data_buckets.key
        data_buckets.value
        FROM
        peq.data_buckets";
        $query_handle = $connect->prepare($query);
        $query_handle->execute();
    
        my $key_name;
        my $key_value;
    
        while(($key_name,$key_value) = $query_handle->fetchrow())
            {            
            quest::say(" babling  $key_name,$key_value");           
            }
                
        
        }
}
thank you!
Reply With Quote