Gossamer Forum
Home : Products : DBMan : Installation :

Using multiple database, where to start?

Quote Reply
Using multiple database, where to start?
I have the regular default database where people post jobs and would like to add an extra database for people to submit registration type information like address, phone, etc. that is not to be viewed by the public and also another dbman database where people can post resumes and can be viewed by the public. All will require unique fields. 3 dbmans and not sure where to start. The main default db is almost complete and haven't started the other 2.. Is there a tutorial anywhere on here or a great thread that will point me in the right direction? I don't know the difficulty involved> I am a beginner in Perl... Where should I turn?
Quote Reply
Re: Using multiple database, where to start? In reply to
Hi wave3,

I'm a hack at this too, just picking up Perl as I use scripts like this one. But I have somehow gotten about 5 or 6 databases all running off of the core dbman engine. Here's how:

Once I have one set up the way I like it, then I copy the files I need to be unique and specify them as a whole new set:

- blah.cfg
- blah.db
- blah.pass
- blah.count
- blah.log
- blah_html.pl

But I can keep just one copy of db.cgi. From there, you just need to modify blah.cfg to point to all the right components and then start modifying it all! And if you share the same password info, you can share that file too. Or the log, if you like.

In one case I have two configurations viewing the same db data -- one brief set of views for the public, and one detailed set for my editors. Same passwd, same log, same count. Different .cfg and html.pl files though.

Once you have more than one set up, just remember to point your URLs appropriately:

http://www.xxx.edu/dbman/db.cgi <-- default db
http://www.xxx.edu/dbman/db.cgi?db=blah <-- blah db
http://www.xxx.edu/dbman/db.cgi?db=foo <-- foo db

Hope this helps,

Neal

[This message has been edited by nmagee (edited July 13, 1999).]
Quote Reply
Re: Using multiple database, where to start? In reply to
thankyou nmagee! It seems to make sense. I'll just start copying files and doing some renaming. I'll make sure to point the files to the right location... I'm sure I may run in to some surprises but I'm extremely impressed with the support on here and how smoothly the first one went.

Thanks for taking the time to reply... If you're out there jpdeni and know some things I should look at for I'm all ears...
Quote Reply
Re: Using multiple database, where to start? In reply to
Looks like you got some really good advice! That's exactly what I would tell you to do.


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





Quote Reply
Re: Using multiple database, where to start? In reply to
You shouldn't have to change db.cgi. What's the error message?


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





Quote Reply
Re: Using multiple database, where to start? In reply to
Glad it helped, wave3. I have to say it's a very good feeling getting a web-based DB up and running, and gossamer has made it quite simple. Kudos to them.

Glad that made sense to you.
Quote Reply
Re: Using multiple database, where to start? In reply to
Thanks again! Hey do I need to change anything in the db.cgi. I'm getting an error message about line 50. I haven't got real far in researching it yet but thought I'd ask you?
Quote Reply
Re: Using multiple database, where to start? In reply to
I got it. I found out you cannot have a dash in a filename. (i.e., r-default.cfg) I changed and all works well. I will be using your password mod JPDeni. I'll send you the URL when complete... Thanks..
Quote Reply
Re: Using multiple database, where to start? In reply to
I am having trouble with this... despite calling the correct db, it always seems to revert to the default one every time as soon as you log in....

is there an obvious reason this is happening?
Quote Reply
Re: Using multiple database, where to start? In reply to
hmm... still having problems... putting http://..../db.cgi?music does not get me into the music db, but http://..../db.cgi?db=music appears to, but then any commands (click on view, etc) cause browser to hang... (the links all point to the default database anyhow - somehow, it does not pick up the database from the URL...)

[This message has been edited by ludwig (edited July 27, 1999).]
Quote Reply
Re: Using multiple database, where to start? In reply to
ok.... I can get around it by going to the URL: http://..../db.cgi?db=music&uid=default
I then get an error message (session expired) and then I can log into that database ok....
AAAAAAAAAAARRRRRRgh.
Quote Reply
Re: Using multiple database, where to start? In reply to
Ludwig, I was having the same problem at first. I'm new at this but I'll tell you why I had that problem. Early on I changed only one small thing in db.cgi. and it caused exactly what you are talking about. I put a uid in the db.cgi and it caused the problem. So I changed it back to what it originally said which was

# Load the form information and set the config file and userid.
local(%in) = &parse_form;
$in{'db'} ? ($db_setup = $in{'db'}) : ($db_setup = 'default');
$in{'uid'} ? ($db_uid = $in{'uid'}): ($db_uid = ''

and all was ok. I don't know if this is what happened but JPDeni is a master of this script and will find your troubles if you never touched this,,,

Good luck
Quote Reply
Re: Using multiple database, where to start? In reply to
no, I did not alter that at all... in fact, the only thing I changed in db.cgi was the path to perl!!

I tried putting in the absolute path to the scripts, but that just confused it and gave errors... so I put it back the way it was..

i have installed loads of scripts, so I'm not a complete greenhorn, but this one has me stumped. (
Quote Reply
Re: Using multiple database, where to start? In reply to
bizarre... got it working now that I append ?db=music to the URL, but never works with just ?music - then it always goes to the default db...
:/
Quote Reply
Re: Using multiple database, where to start? In reply to
still the same... still can't get it to work the way it should

[This message has been edited by ludwig (edited July 28, 1999).]
Quote Reply
Re: Using multiple database, where to start? In reply to
The correct way to call a database other than the default is the way you're doing it --

?db=music

You must use the db= part.

Are you having any other problems?


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





Quote Reply
Re: Using multiple database, where to start? In reply to
no other problems so far... at least none that I haven't figured out. The release notes say that you call a different database with just ?db_name on the end of the URL... they say nothing of ?db=db_name.

that's wot confused me!