Gossamer Forum
Home : Products : DBMan : Customization :

Cutting Down Overhead: Integration of Two db.cgi files

Quote Reply
Cutting Down Overhead: Integration of Two db.cgi files
Carol et al,

Well, I have two databases that have separate .cfg, .pl, .db, and .pass. They both use the same routines in the db.cgi file. However, I am currently using two versions of db.cgi because the email routines (confirmation, send record, private email, etc.) are different because the structure of the data in the databases are VERY different.
Also, to complicate things...the position of the Validation field is different. Of course, I know that I can change the .cfg files to make similar fields the same field number. But I am stumbling over how to create flags or routines in the script that will take specific data from each database files and password files pertaining to the email routines.

I was wondering if there is a way to consolidate the db.cgi files (they are both 115K). It would be nice to consolidate them into one script.

Also, consolidating the db.cgi scripts will enable me to hopefully allow searches accross databases (like with radio buttons) for similar fields.

I hope this request is not too confusing.

Any ideas?

Thanks.

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 29, 1999).]

[This message has been edited by Eliot (edited August 29, 1999).]
Quote Reply
Re: Cutting Down Overhead: Integration of Two db.cgi files In reply to
The position of the Validate field doesn't matter, as long as the name is the same. I don't think would matter, anyway, unless your validation routine is very different from the one I have.

Similarly, most of the other routines you mentioned either refer to fields by name or they use a value set in the .cfg file. I don't see that there should be a problem.

Quote:
Also, consolidating the db.cgi scripts will enable me to hopefully allow searches accross databases (like with radio buttons) for similar fields.

I don't think so. Searches are a very different thing. Even if the structure of your databases was identical, there would be a problem with searching across databases.

You can choose which database to search with a radio button, but I don't see how you can search through multiple databases with one search, even if the field names are the same between databases.


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





Quote Reply
Re: Cutting Down Overhead: Integration of Two db.cgi files In reply to
Carol,

Thanks for the response.

Quote:
Similarly, most of the other routines you mentioned either refer to fields by name or they use a value set in the .cfg file. I don't see that there should be a problem.

As I mentioned, the structure of the databases are quite different. They have different field names, so that is why I am having difficulty in visioning how the two db.cgi files can be integrated into one. For instance, the email confirmations use $html_title and each database has a different title. Also, permissions are set differently for each database, so the email messages sent out are quite different for each database.

Any pointers or suggestions that would effectively meld the two .cgi files into one is greatly appreciated. Not a huge deal, but I thought if I could reduce redundancy, I would attempt it.

The searching is not a huge deal either. But having the ability to use radio buttons to search either database would be a neat feature.

Smile

Thanks.

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
Quote Reply
Re: Cutting Down Overhead: Integration of Two db.cgi files In reply to
The only thing I can suggest then, is that you assign different names to your "similar, but different" subroutines so you can call the one you need at any given time.

You'll also need to add code to sub main in db.cgi for each of the subroutines.

We've discussed using radio buttons to determine which database to search. Do you need me to go over it again?


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





Quote Reply
Re: Cutting Down Overhead: Integration of Two db.cgi files In reply to
Nope...I understand how to integrate the radio buttons into the search forms. It is cleaning up the db.cgi files so that they will handle distinct data within each of the databases that I am most concerned about.

Smile

I assume that I will also have to add codes to require the additional files (.db, .pass, and .cfg).

Great! Just wanted to hear your opinion whether or not this is a doable task. Since it seems that it is possible...I will get working on it in the next few days.

Thanks for the pointers. (I may pick your brain later next week or in the next few weeks if I run into problems. BTW: Never was able to leave town...car is still in the shop...But fate has a way of working itself out...I got a job offer over the weekend with a Fortune 500 Company...so, fate has a way of working things out.)

Smile

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 29, 1999).]
Quote Reply
Re: Cutting Down Overhead: Integration of Two db.cgi files In reply to
I don't think you need to require any extra files. Since you can only work with one database at a time, you only need to require one .cfg file at a time, which is determined by the form or the link that calls the script. And the .cfg file lists the .db, .pass and other files that are needed.

Sorry you didn't get to go on your vacation. Maybe the car gods knew more than you did. Smile

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