Gossamer Forum
Home : Products : DBMan : Customization :

More pesky questions.

Quote Reply
More pesky questions.
Have a 4 meg db file. The file is too big.
29 seconds to return 1 record. DbManSQL too expensive (maybe next year!). This file will _never_ change. It is used only for reporting.

Is there a way to get db.cgi to determine from code which db to use. If so I could split this up into 66 much smaller files. I'm thinking:

pass db.cgi?verse=Gen+1:1
($key, $value) = split /=/ARGV[0]/;
$db_file = split /+/$value/;
$db_file_name = $db_script_path . $db_file;

Where would I try to put these?

Thanks

joe/
Quote Reply
Re: More pesky questions. In reply to
The easiest thing to do is add radio buttons in your search sub-routines for the various database files, like the following:

Code:
<input type="radio" name="db" value="database1"> Database1
<input type="radio" name="db" value="database2"> Database2

Change database1 and database2 to the names of your database files. Repeat the codes for your other databases.

Remember that you will need to have separate .cfg files for each database. If the database s are structured the same, you can use the same html.pl file and db.cgi file.

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: More pesky questions. In reply to
True, but then I'd need inputs for 66 files. What I'd like to accomplish is passing it through the links. For example:

db.cgi?db=KJVGEN
Then it looks to that db file. Everything else should be identical.

Additionally, I'd like to pass record information on the command line. Like
db.cgi?db=KJVGEN&verse=6:5

Then I'll use the KJVGEN.db file, parse the verse variable to get 006005 and return for ID=006005.

(After I get this working, I'll do more, but this is step 1)

Thanks

joe
Quote Reply
Re: More pesky questions. In reply to
If everything is static I'd do the initial search of the list of 66 possible db with a an external cgi program that:

1) receives request from html form
2) parse reqest into db and search variables
3) search list of 66 possible db using db variable
4) if db found then
5) kick off dbman url with correct db and search variables included.



------------------
JGU