X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=bin%2Fimport_ward_data;h=bf970a2565b17e1cc9834e838fb4586c4976517a;hb=4800cbc5c11e33d6f32ea72c80c07a71ab02c158;hp=4f88fd928e10e8ab58c8cfbeee39e4c66a003fe4;hpb=df320830596790d3601a8a693227103d1f6df11f;p=eq%2F.git diff --git a/bin/import_ward_data b/bin/import_ward_data index 4f88fd9..bf970a2 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -131,6 +131,7 @@ sub update_eq_aaronic_table #| Field | Type | Null | Key | Default | Extra | #+-------------+------------------+------+-----+---------+----------------+ #| elder | int(16) unsigned | | PRI | NULL | auto_increment | +#| indiv_id | int(16) unsigned | | | NULL | | #| name | varchar(60) | YES | | NULL | | #| phone | varchar(12) | YES | | NULL | | #| email | varchar(120) | YES | | NULL | | @@ -174,7 +175,7 @@ sub update_eq_elder_table if($rows == 0) { # No existing records found for this elder, make a new entry print " Adding new Elder: $elder_name\n"; - $sth = $dbh->prepare("insert into eq_elder values (NULL,'$elder_name','$phone','','1','','1','',$attending,1)"); + $sth = $dbh->prepare("insert into eq_elder values (NULL,'$id','$elder_name','$phone','','1','','1','',$attending,1)"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; } elsif($rows == 1) { # An existing record was found for this elder, update it @@ -189,6 +190,8 @@ sub update_eq_elder_table $sth->execute or die "-E- DB error: $DBI::errstr\n"; $sth = $dbh->prepare("update eq_elder set attending='$attending' where name='$elder_name'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; + $sth = $dbh->prepare("update eq_elder set indiv_id='$id' where name='$elder_name'"); + $sth->execute or die "-E- DB error: $DBI::errstr\n"; } else { # More than one record was found. Error! This shouldn't happen. print " -E- More than one record found ($rows) for Elder: $elder_name\n";