Displaying 2 results from an estimated 2 matches for "db_user_nam".
Did you mean:
db_user_name
2006 Mar 27
5
Accessing Session Object from a model
...i''m stuck with it.
I need to be able to tell my model what DB to connect to based on what
profile the logged in user has. Something similar to:
[code]
class Report < ActiveRecord::Base
establish_connection({
:adapter => MyConfig.config(:db_adaptor),
:username => MyConfig.config(:db_user_name),
:password => MyConfig.config(:db_password),
:database => @session[:user].profile.name + "_dbname"
})
set_table_name "reports"
.
.
.
end
All the DBs have the same login information so the only thing I need to
change is the :database attribute, but I can''t figur...
2005 Jul 15
0
Queue_log stats
...text,
# info2 text,
# info3 text,
# timestamp int(11) NOT NULL default '0',
# id tinytext NOT NULL
#) TYPE=MyISAM;
use DBI;
use IO::File;
my $opt_debug = 0;
# if you want postgres change this to "Pg"
my $db_type = "mysql";
my $db_host = "127.0.0.1";
my $db_user_name = 'username';
my $db_password = 'password';
my $db_database = 'asteriskstat';
my $dbh = DBI->connect("DBI:$db_type:dbname=$db_database;host=
$db_host;", $db_user_name, $db_password);
open(FIFO, "< /var/log/asterisk/queue_log") or die &quo...