Gossamer Forum
Home : Products : DBMan : Customization :

sigh, another prob

Quote Reply
sigh, another prob
I changed some things for my DBMan, but now when I add a record, it shows it as blank in the success page. JPDeni, you said before to change the $db_key = 'ID'; and I did this, but it still won't work.

I'm also trying to get the 1 account = 1 record to work. I changed the values of the $db_key,$db_key_track, $auth_modify_own = 1, $auth_user_field and the above problem occured.

Is the field I'm using, ID, ok for everything here?

I'm completely clueless here....
Quote Reply
Re: sigh, another prob In reply to
files at: http://www.webigns.com/help/
Quote Reply
Re: sigh, another prob In reply to
This doesn't relate to your current problem, but you will eventually have a problem with your StudentOccupation select list. You need to take out the spaces between the options.

Code:
Wrong:
StudentOccupation => 'School-K or below, School-1st Grade, School-2nd

Right:
StudentOccupation => 'School-K or below,School-1st Grade,School-2nd

You can't use $auth_modify_own unless you have a field for the userid. That's the only way the script knows who "owns" a record. And you'll need to set the $auth_user_field to the number of that field. (I know I told you to set it to -1, but that's because I didn't see a userid field in your database.)

You might want to start over with a blank database since you have made some changes to the fields.


------------------
JPD





Quote Reply
Re: sigh, another prob In reply to
I think I'm getting a little confused over ID and Userid. Is ID useless? And Userid, it's not supposed to be added anywhere in the html.pl, right? And Userid, should its line in the .cfg be:

Userid => [20, 'alpha', -2, 15, 0, '', '']

Quote Reply
Re: sigh, another prob In reply to
The ID field that is in the original demo is a counter field. It creates a unique identifier for each record -- key field. You can certainly use it as the key field, whether you have a userid field or not. If each user is only going to have one record, you can delete the ID field and use the Userid field as a unique identifier for your database. If you do this, be sure to set $db_key_track to 0!

The userid field is used to assign a record to a user. It is automatically entered when a record is added (which you found out with your select field). There must be a userid field if you are going to have users modifying (or viewing) their own records, so the script will know who is the owner of the record.

You must have a field in sub html_record_form for the userid. It can be a hidden field, though.

The format you have for the definition of the Userid field is correct.

Does this help?

------------------
JPD





Quote Reply
Re: sigh, another prob In reply to
Oh, ok, thanks. But do you need something for Userid in the sub html_record part of html.pl?
Quote Reply
Re: sigh, another prob In reply to
No. You don't have to print out the userid in search results if you don't want to.


------------------
JPD





Quote Reply
Re: sigh, another prob In reply to
OK, now I'm getting a "duplicate key error" when I try to add a record. Even when I create a new account and try to add a record, I get this error. Any way to fix it?
Quote Reply
Re: sigh, another prob In reply to
Your problem is that you didn't renumber your fields when you took out the "ID" field. The field numbers must start with 0. Which also means that your $auth_user_field will be field 19.

You will probably have to start with an empty database again.

There may be other problems, too, but this is the most obvious one.


------------------
JPD





Quote Reply
Re: sigh, another prob In reply to
i need to clear out my database, too.
do you just upload a blank copy of the database file?
Quote Reply
Re: sigh, another prob In reply to
Yep.


------------------
JPD





Quote Reply
Re: sigh, another prob In reply to
Thanks, it's working now Smile Guess my next task is the file uploading. Quick question here, is it possible/easy to make it so that you have 2 different fields for uploading? Like 1 for images, 1 for a sound file?

Oh yeah, telling you this in case you have a file where you copy and paste the code to some answers:
in the 1 account = 1 record, you have a typo in the following line:

print qq!| <A HREF="$db_script_link_url&modify_form=1$db_key=$db_userid">Modify</A> ! if ($per_mod);

After some guessing, there needs to be a "&" right after &modify_form=1

Thanks for the help & PATIENCE..definitely the patience b/c others would probably be screaming at me Smile

-Bubba
Quote Reply
Re: sigh, another prob In reply to
Thanks for noticing the typo. Fortunately, it was just typed for you, so it's not saved wrong anywhere. Unfortunately, I'll probably do it again. Smile

The file upload mod only allows one file per record. I fudged someone else's script that I really didn't understand, so I'm not very good at doing any custom tweaking of it. The only thing I've tested it with are .jpg and .gif files.



------------------
JPD