Gossamer Forum
Home : Products : DBMan : Discussions :

Re: [JPWiese] What kind of database should I make - Single or Relational?

Quote Reply
Re: [JPWiese] What kind of database should I make - Single or Relational? In reply to
1) What is the difference between the fields Keyfield and Userid as mentioned in JPDeni's configurator?

A key field can be used as a counter for instance to keep track of record IDs. This field is used so the script can associate the records within your database when using links or the forms.

Your userid field would be the login name to be able to associate records with their 'owner'.

2) How can I have the system to get the date (PostDate) automatic and keep it unchanged?

In your .cfg file set the field date as:

'PostDate' => [ 4,'alpha',35,35,&get_date,'',''],

3) How can I have the system to get the date (ModDate) and change it every time the record is modefied?

In html.pl, sub html_modify_form_record, just after the line that starts with

if (!%rec) { &html_modify_failure (

add

$rec{'ModDate'} = &get_date; # Last modified date

4) How do I set up validation so I or another admin can validate the new or modified record before its visible?

You would install the validation mod which is available in either the GT Resource Center or JPDeni's website http://jpdeni.com/dbman/
Just follow the instructions carefully to setup the mod.

5) We have a lot of members addresses and info today in htmlpages. Is there a way I can register it myself in the
database and change owner after the members having registered with their own UserName?

To setup the script to automatically insert the UserID when someone is logged in and adds a record you would make the following changes. What this does it sets the userid to the logged in userid unless admin is adding a record. You could have people signup and then provide you with the UserID afterwards (via a form you provide, etc) and then modify the record to add their UserID.

Add userid automatically when adding records - make the following changes in db.cgi:

In sub get_defaults replace:

foreach $field (keys %db_defaults) {
$default{$field} = $db_defaults{$field};
}

with:

foreach $field (keys %db_defaults) {
$default{$field} = $db_defaults{$field};
####### add userid in add form ###########
unless ($per_admin) { ($auth_user_field >=0) and ($db_defaults{$db_cols[$auth_user_field]} = $db_userid); }
}


In sub add_record instead of:

# Set the userid to the logged in user.
##### ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);

use:

# Set the userid to the logged in user (except if admin).
unless ($per_admin) { ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid); }

Have you checkout out the DBMan FAQ noted below? All of the answers to your questions can be found within the FAQ.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Subject Author Views Date
Thread What kind of database should I make - Single or Relational? JPWiese 3963 Aug 30, 2002, 4:52 AM
Thread Re: [JPWiese] What kind of database should I make - Single or Relational?
LoisC 3875 Aug 30, 2002, 9:31 AM
Thread Re: [LoisC] What kind of database should I make - Single or Relational?
JPWiese 3875 Sep 1, 2002, 12:13 PM
Thread Re: [JPWiese] What kind of database should I make - Single or Relational?
LoisC 3876 Sep 1, 2002, 2:07 PM
Post Re: [LoisC] What kind of database should I make - Single or Relational?
JPWiese 3869 Sep 1, 2002, 10:21 PM