Modified to allow the display_name to be NULL

git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@21 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-05-28 08:03:12 +00:00
parent 4923712238
commit ed04f81dda
2 changed files with 4 additions and 2 deletions

View File

@@ -127,7 +127,7 @@ CREATE TABLE `pmgr_contacts` (
`middle_name` VARCHAR(255) DEFAULT NULL,
`last_name` VARCHAR(255) DEFAULT NULL,
`company_name` VARCHAR(255) DEFAULT NULL,
`display_name` VARCHAR(512) NOT NULL,
`display_name` VARCHAR(512) DEFAULT NULL,
-- FEDERAL ID, e.g. SSN or EIN
`id_federal` VARCHAR(16) DEFAULT NULL,
@@ -137,6 +137,8 @@ CREATE TABLE `pmgr_contacts` (
`id_state` CHAR(2) DEFAULT NULL,
`id_exp` DATE DEFAULT NULL,
`comment` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View File

@@ -513,7 +513,7 @@ foreach $row (@$result) {
$row->{'AltLastName'} || undef,
($row->{'AltLastName'} && $row->{'AltFirstName'}
? "$row->{'AltLastName'}, $row->{'AltFirstName'}"
: ($row->{'AltLastName'} || $row->{'AltFirstName'} || '<UNKNOWN>')))
: ($row->{'AltLastName'} || $row->{'AltFirstName'} || undef)))
)) . ")";
query($db_handle, $query) || die("Unable to insert");