##get the feed table
my $table= $dbh->prepare("SELECT feed_table FROM database.streamTable where id = ? ");
$table->execute($client_ID);
$feed_table = $table->fetchrow_array();
####
##connect to the feed database and then run query to find tables
my $from_feed_host="production-feed.czdsk6vbk.us-west-2.rds.amazonaws.com";
my $from_feed_dsn = "DBI:mysql:database=$dbrow;host=$from_feed_host";
#my $from_feed_dsn = "DBI:mysql:host=$from_feed_host";
my $from_feed_user="root";
my $from_feed_pass="sewetrol";
my $dbh2 = DBI->connect( $from_feed_dsn, $from_feed_user, $from_feed_pass, { RaiseError => 1, PrintError => 1 }) or die ( "Couldn't connect to database: " . DBI-$
##Connect to the test feed02 database instance and insert data in staging
my $destination_host="staging-feed02.czrdsk.us-west-2.rds.amazonaws.com";
my $destination_dsn = "DBI:mysql:database=$dbrow;host=$destination_host";
my $destination_user="root";
my $destination_pass="S3w3l^16";
my $dbh3 = DBI->connect( $from_feed_dsn, $from_feed_user, $from_feed_pass, {RaiseError => 1, PrintError => 1 }) or die ( "Couldn't connect to database
####
Warning: Using a password on the command line interface can be insecur
+e.
*************************** 1. row ***************************
id_code: 10153812429735_10154227424399735
entry_time: 2016-10-24 21:13:32
parent_id_code: 28193we4734_10153815104343735
author_name: Chweweles+Lawevin
author_code: 102057rw81019807
author_url: https://www.facebook.com/1020dfdfw81019807
author_image_url: http://graph.facebook.com/102fdf1019807/picture
entry_url: https://business.facebook.com/2819gf4734/posts/101gf
+g815100339735?comment_id=101db8699735
entry_types: PHOTO COMMENT
status_code: MOD
entry_text: dfdppe+Lafdvin
entry_data: {"is_hidden":false,"can_hide":true,"can_remove":true
+,"can_comment":true}
last_update: 0000-00-00 00:00:00
pull_time: 2016-11-16 19:07:27
queue_code: NULL