X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=bin%2Fimport_ward_data;h=6bbfe5657c72c750d25b1dd097ec60d8b06c8a03;hb=618c7a09c5e0b99ca1ef5381aa2349802d11098b;hp=670383662bcd0a0d9bef1649a5a5c0612dcf0852;hpb=90140f92cb6d1c31d7ef617796b580d22b10ab47;p=eq%2F.git diff --git a/bin/import_ward_data b/bin/import_ward_data index 6703836..6bbfe56 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -249,16 +249,16 @@ sub update_tc_district_table $sth = $dbh->prepare("select * from tc_district"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; while($sqlhashref = $sth->fetchrow_hashref) { - $supervisor_name = $sqlhashref->{name}; - $district = $sqlhashref->{district}; - $sth2 = $dbh->prepare("select * from tc_individual where name='$supervisor_name'"); - $sth2->execute or die "-E- DB error: $DBI::errstr\n"; - $sqlhashref2 = $sth2->fetchrow_hashref; - $supervisor_id = $sqlhashref2->{individual}; - $sth2->finish(); - $sth2 = $dbh->prepare("update tc_district set supervisor='$supervisor_id' where district='$district'"); - $sth2->execute or die "-E- DB error: $DBI::errstr\n"; - $sth2->finish(); + $supervisor_name = $sqlhashref->{name}; + $district = $sqlhashref->{district}; + $sth2 = $dbh->prepare("select * from tc_individual where name='$supervisor_name'"); + $sth2->execute or die "-E- DB error: $DBI::errstr\n"; + $sqlhashref2 = $sth2->fetchrow_hashref; + $supervisor_id = $sqlhashref2->{individual}; + $sth2->finish(); + $sth2 = $dbh->prepare("update tc_district set supervisor='$supervisor_id' where district='$district'"); + $sth2->execute or die "-E- DB error: $DBI::errstr\n"; + $sth2->finish(); } $sth->finish(); }