Carol,
Okay...I got a real stinker for ya or anyone else that wants to take a stab at it.
I have two databases, which differ in structure, yet have similar fields. What I would like to do is link fields between databases. I have separate files for each datbase (including db.cgi, html.pl and default.cfg). I know that the easiest thing to do would be to have one db.cgi file, but since our database programs are live, and our test environment is being re-configured, I really don't have the luxury of making any changes to the file structure of the databases at this time.
The two fields that I would like to try to link between the databases are:
SUBJ = Course Subjects
TITLE = Title of Courses
Note: Be aware that these fields have multiple values because instructors teach multiple classes each semester. Also, remember that I have renamed my db.cgi to index.cgi.
I have done the following:
1) Added the following codes to the db.cgi file of the Employee Directory Database:
$in{'db'} = $in{'SUBJ'};
}
2) Added the following variable to the default.cfg in the Employee Directory:
3) Added some regular expression statements to the html_record_long sub-routine in the html.pl file:
$rec{'TITLE'}=~ s,(<[^>]+> )|(\b\Q$rec{'TITLE'}\E\b),defined($1) ? $1 : "\<BR>$2",gie;
I have other regular expression statements that puts ,<BR> codes between values of the two fields:
$rec{'SUBJ'} =~ s/~~/,<BR>/g;
$rec{'TITLE'} =~ s/\|/,<BR>/g;
$rec{'TITLE'} =~ s/~~/,<BR>/g;
I added the top regular expression statements because I was getting a Bad Request Error due to the <BR> codes that were being inserted into the query string.
4) Added a link to the SUBJ row in the html_record_long sub-routine:
print qq| <TR><TD VALIGN="TOP" WIDTH="300" BGCOLOR="EEEEEE"><$font_color><B>Courses:</B></FONT></TD>
<TD WIDTH="300" BGCOLOR="FFFFFF"><$font><a href="$class_link&SUBJ=$rec{'SUBJ'}">$rec{'SUBJ'}</a></Font></TD></TR>|;
}
So, what I need to do is find a way to link the multiple values in at least the SUBJ field between the two databases.
Any ideas??
TIA.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited August 19, 1999).]
Okay...I got a real stinker for ya or anyone else that wants to take a stab at it.
I have two databases, which differ in structure, yet have similar fields. What I would like to do is link fields between databases. I have separate files for each datbase (including db.cgi, html.pl and default.cfg). I know that the easiest thing to do would be to have one db.cgi file, but since our database programs are live, and our test environment is being re-configured, I really don't have the luxury of making any changes to the file structure of the databases at this time.
The two fields that I would like to try to link between the databases are:
SUBJ = Course Subjects
TITLE = Title of Courses
Note: Be aware that these fields have multiple values because instructors teach multiple classes each semester. Also, remember that I have renamed my db.cgi to index.cgi.
I have done the following:
1) Added the following codes to the db.cgi file of the Employee Directory Database:
Code:
if ($in{'SUBJ'}) { $in{'db'} = $in{'SUBJ'};
}
2) Added the following variable to the default.cfg in the Employee Directory:
Code:
$class_link = "http://www.coco.cc.az.us/cgi-bin/schedules/index.cgi?db=default&uid=default&view_records=1";3) Added some regular expression statements to the html_record_long sub-routine in the html.pl file:
Code:
$rec{'SUBJ'} =~ s,(<[^>]+> )|(\b\Q$rec{'SUBJ'}\E\b),defined($1) ? $1 : "\<BR>$2",gie; $rec{'TITLE'}=~ s,(<[^>]+> )|(\b\Q$rec{'TITLE'}\E\b),defined($1) ? $1 : "\<BR>$2",gie;
I have other regular expression statements that puts ,<BR> codes between values of the two fields:
Code:
$rec{'SUBJ'} =~ s/\|/,<BR>/g; $rec{'SUBJ'} =~ s/~~/,<BR>/g;
$rec{'TITLE'} =~ s/\|/,<BR>/g;
$rec{'TITLE'} =~ s/~~/,<BR>/g;
I added the top regular expression statements because I was getting a Bad Request Error due to the <BR> codes that were being inserted into the query string.
4) Added a link to the SUBJ row in the html_record_long sub-routine:
Code:
if ($rec{SUBJ} gt $db_default{'SUBJ'}) { print qq| <TR><TD VALIGN="TOP" WIDTH="300" BGCOLOR="EEEEEE"><$font_color><B>Courses:</B></FONT></TD>
<TD WIDTH="300" BGCOLOR="FFFFFF"><$font><a href="$class_link&SUBJ=$rec{'SUBJ'}">$rec{'SUBJ'}</a></Font></TD></TR>|;
}
So, what I need to do is find a way to link the multiple values in at least the SUBJ field between the two databases.
Any ideas??
TIA.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited August 19, 1999).]