Gossamer Forum
Home : Products : DBMan : Customization :

Strange problem with List All

Quote Reply
Strange problem with List All
Pulling my hair out here (need help quick, as I don't have much to begin with! Shocked

For the life of me, I can not see the problem.

I added some fields into my db. Have them defined in .cfg and in my html_record & html_record_form.

Everything looks fine. When I input, looks fine, when I add, looks fine. add_success displays the record and emails the results fine. When I do a search for view/modify/delete for the additional records added, the individual records come up fine. The info in the .db looks fine.

My problem is that when I do a List All, my information slides down the page from one record into the other, i.e.

Name: John
Date: 30 June, 2004
Hobby: Not this!
Place: Anywhere
Car: Yes
Plane: No

Name: Anywhere
Date: Yes
Hobby: No
Place: Steve
Car: 30 June, 2004
Plane: My hobby

Name: Anywhere
Date: Yes
Hobby: Yes
Place: Anywhere
Car: Yes
Plane: Yes

And so on. It is pulling the same information from the last 3 fields of the previous record to start the new record in the display. Therefore, the data from the second record is displayed in the wrong fields. This only happens when listing out multiple records

Any clues where to look? I have gone over and over my html_record layout and html_record_form and I can't see a problem. It is my assumption that if it was in html_record, none of the functions would display right (add/preview/email/printout, etc....)

Help,

Balding Quickly
Quote Reply
Re: [jlamphear] Strange problem with List All In reply to
A couple of suggestions... check for duplicate or missing "Field Numbers" in default.cfg

Example (0,1,2,3,4) :

ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 255, 1, '', ''],
URL => [2, 'alpha', 40, 255, 1, 'http://', '^http://'],
Type => [3, 'alpha', 0, 60, 1, '', ''],
Date => [4, 'date', 12, 15, 1, &get_date, ''],

Also pull your default.db file into Excel and see if your fields are off somewhere.

Example:

1|bob|red|boy|up
2|sue|green|girl|down
3|orange|boy|up

(notice #3 is missing a field)
Quote Reply
Re: [Watts] Strange problem with List All In reply to
Thanx for the reply. Yes, I had checked those and there is no replication of numbers and all the datafields are there with data. When I pull individual records, all the info is placed in the proper field. All the info is contained in email sent as part of the mod add process. All the info prints into the printout to text file mod, etc... It is only when I go to list multiple records.

Weird huh?
Quote Reply
Re: [jlamphear] Strange problem with List All In reply to
Whenever I used to have that problem (way back when) it was when the database became corrupted.
To keep this from happening I added a line in sub parse_form within the db.cgi file:

after:

if ($value eq "---") { next PAIR; } # This is used as a default choice for select lists and is ignored.

add:

unless ($value) { next PAIR; } # eliminate the last | when records are added to the database or when a search is performed.



For some reason this kept the database from corrupting. If you use the line above, be sure to remove the last | at the end of each line of your .db file.

You may want to recheck your database again. Sort by ID number or the order the records were added to the db. Once you find where the display is off, it will usually be that record or the previous record that is causing the problem.

If you still can't find the problem, perhaps an extra set of eyes will help. Post a .txt copy of both your .cfg file and .db file and we can check it over for you.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Strange problem with List All In reply to

Here they are. If you see it, let me know. Thanx folx! Smile

Also attached are images of record 1 and record 2 as displayed in the list all.

1.jpg & 2.jpg




Quote Reply
Re: [jlamphear] Strange problem with List All In reply to
This may have something to do with it (in default.cfg):

Training => [20,'alpha', '50x1', 250, 0, '', ''], <--- Remove this comma only

Remove the comma from the last field configuration (in bold). Think of it as a list (such as 1, 2, 3, 4) that is displayed like this:

1,
2,
3,
4

There should be no comma after the last item.

Last edited by:

Watts: Jul 1, 2004, 7:33 AM
Quote Reply
Re: [Watts] Strange problem with List All In reply to
Hopefully Watts's solution will help.

Since there are only 2 records in the db file you attached we can't help you check out the field to see where the error may be happening.

You can use my suggestion above to try and locate the record(s) that may be throwing off the records, if you are still having problems. I can understand if you don't want to post your full database, in case it contains information you don't want others to see.

If all else fails and you still can't find the problem, you can attach your full .db file via private message to either myself or Watts and we can try and help find the record that may be corrupting the database.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Strange problem with List All In reply to
I tried Watts suggestion and it made no difference. The database I sent, is enough to see the problem. That is the test data that I am using, as the new changes have not been rolled out. You can start with a clean (empty .db) and input 2 records and the problem is there (see the attached .jpgs to the previous message) It happens immediately.

I would however, send you my html.pl and my .cfg in a private message, as that does contain info I do not want to publish, but I suspect the problem lies within the html.pl
Quote Reply
Re: [jlamphear] Strange problem with List All In reply to
have you tried turning on autogenerate to see if the records display properly that way? if so, that would probably verify your suspicion that your html file is bad.
Quote Reply
Re: [delicia] Strange problem with List All In reply to
Thanks. I just tried that and received the same results. hmmmm
Quote Reply
Re: [jlamphear] Strange problem with List All In reply to
i don't know if it's possible but do any of the fields contain the delimiter character?
Quote Reply
Re: [jlamphear] Strange problem with List All In reply to
Quote:
but I suspect the problem lies within the html.pl

Probably so... Send me a PM with the html.pl file attached and I'll look and see if something is wacky.
Post deleted by jlamphear In reply to
Quote Reply
Re: [Watts] Strange problem with List All In reply to
I think I may have found the problem, when you added the extra fields you didn't update your switch codes:

sub switch_to_status {
#-----------------------------------------------------
# $cols = 'UserID,ID,Date,PM,UserEmail,Highlight_1,Detail_1,Highlight_2,Detail_2,Highlight_3,Detail_3,Next_1,Next_2,Next_3,Training';

$cols = 'UserID,ID,Date,PM ,UserEmail,Highlight_1,Detail_1,Highlight_2,Detail_2,Other_1,OtherDet_1,Other_2,OtherDet_2,Other_3,OtherDet_3,Other_4,OtherDet_4,Next_1,Next_2,Next_3,Training';

@db_cols = split /,/,$cols;
$db_file_name = $db_script_path . "/status.db";
$db_key_pos = 1;
$db_sort{'Date'} = 'date';
}

Recheck if you didn't add the same fields to this database:

sub switch_to_highlite {
#-----------------------------------------------------
# $cols = 'UserID,ID,Date,PM,UserEmail,Highlight_1,Detail_1,Highlight_2,Detail_2,Highlight_3,Detail_3,Next_1,Next_2,Next_3,Training';
$cols = 'UserID,ID,Date,PM ,UserEmail,Highlight_1,Detail_1,Highlight_2,Detail_2,Other_1,OtherDet_1,Other_2,OtherDet_2,Other_3,OtherDet_3,Other_4,OtherDet_4,Next_1,Next_2,Next_3,Training';

@db_cols = split /,/,$cols;
$db_file_name = $db_script_path . "/highlite.db";
$db_key_pos = 1;
$db_sort{'Date'} = 'date';
}


I added 3 records and they displayed just fine so I think that is what the problem was. If not, let me know and I'll continue to see if I can find anything else.

It really did help to know what mods you added and when things went wrong, I knew where to look right away :)

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Strange problem with List All In reply to
Yes, oh, Yes! Thank you, thank you, thank you! You are awesome!

What can I do to ever repay you. Thank you for your time and patience LoisC.

You are truly a blessing.


Also, thanks go out to the others who pitched in as well. You are all the greatest.

Sincerely,

John SmileSmileSmileSmile
Quote Reply
Re: [jlamphear] Strange problem with List All In reply to
Your very welcome :)

I'm soooo glad that you now have it all working again. I should have asked what mods you were using earlier and maybe we could have figured this out sooner.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Strange problem with List All In reply to
Well, all in all, it shows me that I need to better document and map my application of the DBMan

That is my project of the day.

Regards,

John
Quote Reply
Re: [LoisC] Strange problem with List All In reply to
Quote:
when you added the extra fields you didn't update your switch codes

Recently there was a post asking if there was someway to "automate" that instead of having to manually type in the fields.

If you know of anything, or have any ideas, let me know.

Maybe we can hack out a solution.

-Mike.