Gossamer Forum
Home : Products : DBMan : Installation :

View multiple databases at once

Quote Reply
View multiple databases at once
How can I view/search multiple databases!


I HAVE TO DO THIS!

Thanks

David

Quote Reply
Re: View multiple databases at once In reply to
OK, before we get in trouble for having double posts ... there's should be a mod to search mulitiple DBs, JPDeni has also made a "relational" mod for DBman.

hehe, I forgot to post in the other thread links to LoisC's and JPDeni's site didn't I !!!

Sorry .... :-(

You may want to check our JPDeni's excellent DBMan tutorial.
http://jpdeni.com/dbman

And LoisC's excellent resource
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/


Thanks to them both.




**************************************
on the pages in between ...
Quote Reply
Re: View multiple databases at once In reply to
Why would I get introuble for having double posts?

They are TWO diffrent subjects

Not illegal is it?

Thanks

David

Ps. Thanks for the links

Quote Reply
Re: View multiple databases at once In reply to
Also, JP Deni's Relational Mod it says "Only for experts or people that are good with Dbman.

Is there anything else...

And I don't know if it allows me to joine 15 or more DBMan databases...

Does it?

Thanks

David

Quote Reply
Re: View multiple databases at once In reply to
What you mean is search in multiple table or database?
If you want to VIEW(only) multiple database you can modify in the query function db.cgi file. You just add this line:
@list_db = qw/default default1/;
foreach $db_file_name (@list_db){
$db_file_name .= '.db';

before the line

open (DB, "<$db_file_name") or ("error in search. unable to open database: $db_file_name.\nReason: $!");

And add this line
}
after the line
close DB;

If you want to modify data in multiple it need a lot of modification.

Hope with this help.

Quote Reply
Re: View multiple databases at once In reply to
no problem, sorry for not posting the links earlier this morning.

double threads ... ummm ... I don't care personally but ... ahhhh never mind sorry.

Atlas's code should do what you need. Call several DBs for searching.
JPDeni mentions that since that mod seems to go on for ever, I figured that just buying LinkSQL would be quicker, easier, simpler, and making a mistake along the way is bound to happen and debugging for that could take time I guess.


Good Luck

**************************************
on the pages in between ...
Quote Reply
Re: View multiple databases at once In reply to
One problem wich line, I have like 5 of that exact message....

open (DB, "<$db_file_name") or &cgierr("error in search. unable to open database: $db_file_name.\nReason: $!");

Which one?

Thanks

David

Quote Reply
Re: View multiple databases at once In reply to
This line should be:
open (DB, "<$db_file_name") or &cgierr("error in search. unable to open database: $db_file_name.Reason: $!");
Because I am using a Japanese browser.

Quote Reply
Re: View multiple databases at once In reply to
Is it by chance this sub rooteen?

sub get_record {
# --------------------------------------------------------
# Given an ID as input, get_record returns a hash of the
# requested record or undefined if not found.

my ($key, $found, $line, @data, $field, $restricted);
$key = $_[0];
$found = 0;
($restricted = 1) if ($auth_modify_own and !$per_admin);

#########################################################

open (DB, "<$db_file_name") or &cgierr("error in get_records. unable to open db file: $db_file_name.\nReason: $!");

#########################################################
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
$line = $_; chomp ($line);
@data = &split_decode($line);
next LINE if ($restricted and ($db_userid ne $data[$auth_user_field]));
if ($data[$db_key_pos] eq $key) {
$found = 1;
for ($i = 0; $i <= $#db_cols; $i++) { # Map the array columns to a hash.
$rec{$db_cols[$i]} = $data[$i];
}
last LINE;
}
}
close DB;
$found ?
(return %rec) :
(return undef);
}





Thanks



David

Quote Reply
Re: View multiple databases at once In reply to
please change in the query function.

Quote Reply
Re: View multiple databases at once In reply to
No, I mean is that the sub that I am suppose to change the quire function on?

Thanks

David

Quote Reply
Re: View multiple databases at once In reply to
atlas,

You are AWESOME! It worked...

Thank you so very very MUCH!

I just have one more question... (Hopefully)

If anyone can answer this one please DO..

Is there a way for me to have 15 diffrent databases and not have to put certain files in each folder and then edit the *.cfg file and so it goes to the correct file.

There has got to be a way.

Please reply.

Thanks

David

Ps. Any one can help

Quote Reply
Re: View multiple databases at once In reply to
There is one teeny tiny problem... I just want to be able to view multiple databases when ever I feal like it.

Like if I wanted to view database 1 and database 2 and database 3 I would put a check mark to search all databases but, what I i just want to search the one I am currently in... default database and not
database 1 and database 2 or database 3.

How can I do that?

Thanks

David



Quote Reply
Re: View multiple databases at once In reply to
Hi,

May be you use check box for user to choose what databa they want to search. I acn help you with a nominal charge.

Regards,




Quote Reply
Re: View multiple databases at once In reply to
Atla,

Yes please do help.

David

Quote Reply
Re: View multiple databases at once In reply to
Hi,

I will send email to you. Tell me your email to we discuss more about this job.

Regards,

Mark

Quote Reply
Re: View multiple databases at once In reply to
webwizz, all you need to do is add tick boxes with the name of the database as the value and in db.cgi replace the database name in the open statement with $in{'tick_box_field'}

You can even use a slect list if you want....it should be very simple.

I have a bit of free time later on and can help if you still need it? (no fee)

Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/
Quote Reply
Re: View multiple databases at once In reply to
PaulWilson,

I really would like that...

Where is the opening statment? I just want to be able to select "Search all Fields" or just unchecked and it will just search the current daatabase... But I also would like to know how to search specific databases like db1 db2 and db3. As well as be able to search all at the same time.

Thanks

David

Quote Reply
Re: View multiple databases at once In reply to
Could I ask why you need so many databases?

Can you not add more fields?

Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/
Quote Reply
Re: View multiple databases at once In reply to
Well, I need all those databases because, I this is a talk show booking database... We have about 15 people that we put on the radio and we need seperate databases for each...

When you help me would to tell me where to enter another database name for like if we get another guest?

Thanks

David

Ps. Email address is dgtech@riverview.net Please continue there.