Lauren asked about future releases supporting relations between databases. It's possible to get the current version of DBMan to work as if there were relations.
This probably would only be appropriate for the more experienced users to try!
I'm using two databases, one called "org" for an employer's basic information and "jobs" for job postings they add. I have a separate file that is called at the beginning of the html.pl files for each which defines (among other things) the basic format of all the pages, as well as the field names for each database and the number of the $auth_user_field for each. (It would have been easier to make the $auth_user_field the same for each one, but I didn't think of this until after I got it set up.) The databases are linked by a field "Org_ID" which is the key in the "org" database.
When a new job is entered, I wanted to pass the location information from "org" to "jobs," so at the beginning of html_add_form in the jobs html.pl file, I used the following:
$db_file_name = $db_script_path . "/org.db";
$auth_user_field = $org_auth_user_field;
@db_cols = @org_cols;
%rec2 = &get_record($db_userid);
$rec{'Organization'} = $rec2{'Organization'};
$rec{'City'} = $rec2{'City'};
$rec{'State'} = $rec2{'State'};
$rec{'Country'} = $rec2{'Country'};
$rec{'Contact_Type'} = $rec2{'Contact_Type'};
&html_record_form (%rec);
I used &get_record($db_userid); because "org" only has one record per user. When I want a list of the jobs listed for each org, I use
$auth_user_field = $jobs_auth_user_field;
@db_cols = @jobs_cols;
$in{'Org_ID'} = $db_userid;
($status, @hits) = &query();
This may not be the best way to do it, but it works!
------------------
JPD
This probably would only be appropriate for the more experienced users to try!
I'm using two databases, one called "org" for an employer's basic information and "jobs" for job postings they add. I have a separate file that is called at the beginning of the html.pl files for each which defines (among other things) the basic format of all the pages, as well as the field names for each database and the number of the $auth_user_field for each. (It would have been easier to make the $auth_user_field the same for each one, but I didn't think of this until after I got it set up.) The databases are linked by a field "Org_ID" which is the key in the "org" database.
When a new job is entered, I wanted to pass the location information from "org" to "jobs," so at the beginning of html_add_form in the jobs html.pl file, I used the following:
Code:
# Pick up info from org db $db_file_name = $db_script_path . "/org.db";
$auth_user_field = $org_auth_user_field;
@db_cols = @org_cols;
%rec2 = &get_record($db_userid);
$rec{'Organization'} = $rec2{'Organization'};
$rec{'City'} = $rec2{'City'};
$rec{'State'} = $rec2{'State'};
$rec{'Country'} = $rec2{'Country'};
$rec{'Contact_Type'} = $rec2{'Contact_Type'};
&html_record_form (%rec);
I used &get_record($db_userid); because "org" only has one record per user. When I want a list of the jobs listed for each org, I use
Code:
$db_file_name = $db_script_path . "/jobs.db"; $auth_user_field = $jobs_auth_user_field;
@db_cols = @jobs_cols;
$in{'Org_ID'} = $db_userid;
($status, @hits) = &query();
This may not be the best way to do it, but it works!
------------------
JPD