Gossamer Forum
Home : Products : DBMan : Installation :

Help - Some Fields are Written/Some are Not!!

Quote Reply
Help - Some Fields are Written/Some are Not!!
Hi All,

I'm having the most bizzare problem configuring and setting up my data. For some reason, the script just refuses to write three of my fields! I have debug on, and I plainly see that the Form Variables are being passed correctly, as I enter them. But they don't get written to the db file. Instead, I just get a empty field marker "| |"

Here is the configuration from the cfg file:
%db_def = (
Item=>[0, 'numer', 5, 8, 0, '', ''],
PhotoGif=>[1, 'alpha', 10, 25, 0, '',''],
Name=>[2, 'alpha', 25, 50, 1,'', ''],
Catagory=>[3, 'alpha', 0, 25, 1,'', ''],
Color=>[4, 'alpha', 0, 20, 0,'', ''],
Description =>[5, 'alpha', '40x3', 200, 0, '', ''],
Pack=>[6, 'numer', 3, 4, 0, '', ''],
Unit=>[7, 'numer', 3, 4, 0, '', ''],
Case=>[8, 'numer', 3, 4, 0, '', '']
);

Item, Unit, and Case are being written as empty. I wanted Item to be my db key and I could only enter one record because the empty Item field is seen as a duplication when I try to enter a second record. For demonstration purposes, I switched the db key to one of the fields that is being written.

You can see all this in action at:
http://hgi.digihosting.com/cgi/dbman/db.cgi?db=drieds

Sign on as admin/admin and see for yourself. Everything else seems to work perfectly, searches, deletes, etc. Also, the demo database runs perfectly on my server so it doesn't seem to be a problem with db.cgi For the life of me, I just can't see anything wrong with the code on my cfg page.

Please Help! I like this program and would like to implement it at a commercial site, but I'm truly stumped! Thanks very, very, much!

Brad
Quote Reply
Re: Help - Some Fields are Written/Some are Not!! In reply to
It looks to me that you have added fields to your default.cfg without adding delimiter characters and default values for these new fields in your existing database.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Help - Some Fields are Written/Some are Not!! In reply to
Eliot,

Thanks for responding!! I don't think I've modified default.cfg at all. The default database runs fine. The snippit of code I posted was from my new database (drieds.cfg) I have all the other associated drieds. files loaded properly I think.

I'm trying to understand what you mean by no delimiter characters... where am I missing delimiter characters? And I wasn't under the impression it was necessary to fill in a default value in the %db_def array. I've just kept it null with '' as you can see. Is that my problem?

Once again, here is my %db_def statement:
%db_def = (
Item=>[0, 'numer', 5, 8, 0, '', ''],
PhotoGif=>[1, 'alpha', 10, 25, 0, '',''],
Name=>[2, 'alpha', 25, 50, 1,'', ''],
Catagory=>[3, 'alpha', 0, 25, 1,'', ''],
Color=>[4, 'alpha', 0, 20, 0,'', ''],
Description =>[5, 'alpha', '40x3', 200, 0, '', ''],
Pack=>[6, 'numer', 3, 4, 0, '', ''],
Unit=>[7, 'numer', 3, 4, 0, '', ''],
Case=>[8, 'numer', 3, 4, 0, '', '']
);

And here is what the script writes to the the .db file:
|PhotoGif|Name|Catagory|Color|Description|Pack| |

See, it's missing the first field (Item) and the last two which follow the number (Pack). The delimiter appears fine. Help anybody?

Brad


Quote Reply
Re: Help - Some Fields are Written/Some are Not!! In reply to
You need to set the db_key variable to what ever Item you want to be the key variable...if it is Item, then you would set it up as follows:

Code:
$db_key = 'Item';

Then if you do not want to "track" this key field, then you would set your $db_key_track to 0, like the following:

Code:
$db_key_track = 0;

Hope this helps.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Help - Some Fields are Written/Some are Not!! In reply to
Eliot,

Thanks anyway, but that isn't the problem. I switched the $db_key to one of the other fields because the field that I wanted ('Item') for the key was not being written. The db_key works fine on my new selection.

I think I've described the problem pretty exhastively in the previous two posts. The .cfg info is there. The form fields are getting posted to the script correctly (per the debug). But the the script is writing null values for the first and last two fields.

Brad
Quote Reply
Re: Help - Some Fields are Written/Some are Not!! In reply to
Was this section copyed out of your CFG file? if so look at the last line after the ]bracket there is no comma ,.

We would need to see you cfg file to tell you more..
Quote Reply
Re: Help - Some Fields are Written/Some are Not!! In reply to
HR,

Yes, the code is from my cfg file. I'm not under the impression that there needs to be a comma after the last value. There isn't one in the default.cfg. I'll try it though! Thanks. What specifically do you need to see from my cfg other than the %db_def?

Brad
Quote Reply
Re: Help - Some Fields are Written/Some are Not!! In reply to
Problem Solved - The long way!

Thanks guys for responding. The problem was just too weird. I figured there must have been some hidden character somewhere in my files that was throwing everything off. There was really no other explaination.

My solution was to take the default files (which had always worked) and carefully modify them. I guess I did a little too much cut and pasting in my prior customization and something got inserted in there that shouldn't be. I just couldn't see it.

Anyway, we're up and running. Now comes the fun part... playing around with searches and html to see if this baby will work for our purposes. Thanks again.

Brad