Hi. I am wondering if anyone can be of assistance with this problem, which is almost certainly an error in the way I'm parsing the data file, but I can't find it. I am having search results show up in the wrong "field" of the generated HTML tables, but only for some of the records. Others work fine.
Here is my database definition in the configuration file:
%db_def = (
Distributor => [0, 'alpha', 40, 60, 0, '', ''],
Address1 => [1, 'alpha', 40, 60, 0, '', ''],
Address2 => [2, 'alpha', 40, 60, 0, '', ''],
City => [3, 'alpha', 30, 60, 0, '', ''],
State => [4, 'alpha', 10, 30, 0, '', ''],
Zipcode => [5, 'alpha', 8, 20, 0, '', ''],
Areacode => [6, 'alpha', 6, 10, 0, '', ''],
Phone => [7, 'alpha', 10, 20, 0, '', ''],
Fax => [8, 'alpha', 10, 20, 0, '', ''],
URL => [9, 'alpha', 60, 255, 0, '', '']
);
Here are 5 lines from the database, using a pipe delimiter:
CED|D/B/A/ ALSTON ELECTRIC SUPPLY|331 NORTH ST. JOSEPH AVE|BREWTON|AL|36426|334|867-6084|NULL|NULL
CED|1302 4TH ST S W|NULL|CULLMAN|AL|35055|256|734-9624|NULL|NULL
CED|1207 CENTRAL PKY SW|NULL|DECATUR|AL|35601|256|355-1933|NULL|NULL
FORBES DISTRIBUTING CO.|1522 5TH AVENUE SE|NULL|DECATUR|AL|35601|NULL|NULL|NULL|NULL
MAYER ELECTRIC SUPPLY CO|3133 HIGHWAY 20 WEST|NULL|DECATUR|AL|35601|256|350-2616|NULL|NULL
The problem that I am having is that although the results are returned when I do a search, they frequently show up on the wrong line.
I am wondering, does the issue lie in the fact that I am using "Distributor" as the primary key and some of them are the same (aren't primary keys supposed to be unique?), or is it possibly that there are characters that have special meaning to Perl (like ampersand, comma)?
I inherited this database project and am not sure how well the previous organization planned the design. Nevertheless, I need to figure out why things are parsing (or at least displaying) incorrectly.
If you want to test the database and see the error (will that help?), you can go to http://www.kwpowell.com/cgi-bin/greenlee/db.cgi and check it out. The userid and password are both "user". Wildcard searches are disabled.
I would also be glad to share the html.pl or any other necessary files if it will help answer this question.
Thanks in advance for any advice you can offer!
------------------
Scot Robnett
srobnett@earthlink.net
Here is my database definition in the configuration file:
%db_def = (
Distributor => [0, 'alpha', 40, 60, 0, '', ''],
Address1 => [1, 'alpha', 40, 60, 0, '', ''],
Address2 => [2, 'alpha', 40, 60, 0, '', ''],
City => [3, 'alpha', 30, 60, 0, '', ''],
State => [4, 'alpha', 10, 30, 0, '', ''],
Zipcode => [5, 'alpha', 8, 20, 0, '', ''],
Areacode => [6, 'alpha', 6, 10, 0, '', ''],
Phone => [7, 'alpha', 10, 20, 0, '', ''],
Fax => [8, 'alpha', 10, 20, 0, '', ''],
URL => [9, 'alpha', 60, 255, 0, '', '']
);
Here are 5 lines from the database, using a pipe delimiter:
CED|D/B/A/ ALSTON ELECTRIC SUPPLY|331 NORTH ST. JOSEPH AVE|BREWTON|AL|36426|334|867-6084|NULL|NULL
CED|1302 4TH ST S W|NULL|CULLMAN|AL|35055|256|734-9624|NULL|NULL
CED|1207 CENTRAL PKY SW|NULL|DECATUR|AL|35601|256|355-1933|NULL|NULL
FORBES DISTRIBUTING CO.|1522 5TH AVENUE SE|NULL|DECATUR|AL|35601|NULL|NULL|NULL|NULL
MAYER ELECTRIC SUPPLY CO|3133 HIGHWAY 20 WEST|NULL|DECATUR|AL|35601|256|350-2616|NULL|NULL
The problem that I am having is that although the results are returned when I do a search, they frequently show up on the wrong line.
I am wondering, does the issue lie in the fact that I am using "Distributor" as the primary key and some of them are the same (aren't primary keys supposed to be unique?), or is it possibly that there are characters that have special meaning to Perl (like ampersand, comma)?
I inherited this database project and am not sure how well the previous organization planned the design. Nevertheless, I need to figure out why things are parsing (or at least displaying) incorrectly.
If you want to test the database and see the error (will that help?), you can go to http://www.kwpowell.com/cgi-bin/greenlee/db.cgi and check it out. The userid and password are both "user". Wildcard searches are disabled.
I would also be glad to share the html.pl or any other necessary files if it will help answer this question.
Thanks in advance for any advice you can offer!
------------------
Scot Robnett
srobnett@earthlink.net