Thank you all for the information. It is obvious that db was not in
scope, so now I call:
set db [ns_db gethandle gamespool]
then I do my queries and everything works fine.
I must apologise for this lack of judgement on my part. It was late
last night when I did this.
Thanks again.
On 01/04/2008, Darren Ferguson <[EMAIL PROTECTED]> wrote:
> Your pool is called gameskillspool and your in /db/pool you just have
> gamespool.
> Respectfully,
> Darren Ferguson
>
>
> Xavier Bourguignon wrote:
>
> > Hi all,
> >
> > I have this in my config file:
> > ns_section "ns/server/games-admin/modules"
> > ns_param nssock $bindir/nssock.so
> > ns_param nslog $bindir/nslog.so
> > ns_param nscp $bindir/nscp.so
> > ns_param nsdb $bindir/nsdb.so
> > ns_param shared_tcl tcl
> >
> > ns_section "ns/db/drivers"
> > ns_param postgres nspostgres.so
> >
> > ns_section "ns/db/pools"
> > ns_param gameskillspool "Postgres"
> >
> > ns_section "ns/db/pool/gamespool"
> > ns_param Driver postgres
> > ns_param Connections 5
> > ns_param DataSource localhost::games
> > ns_param User postgres
> > ns_param Password "secret"
> > ns_param Verbose On
> > ns_param LogSQLErrors On
> > ns_param ExtendedTableInfo On
> > ns_param Connection 5
> >
> > ns_section "ns/server/games-admin/db"
> > ns_param Pools *
> >
> > I have the following in my db.tcl file:
> > set db [ns_db gethandle "gamespool"]
> > set datasource [ns_db datasource $db]
> > set dbtype [ns_db dbtype $db]
> > set driver [ns_db driver $db]
> > set poolname [ns_db poolname $db]
> > set user [ns_db user $db]
> > set password [ns_db password $db]
> >
> > In file admin_op.tcl I do this:
> > set row [ns_db select $db "select * from tadminoptype;"]
> > while { [ns_db getrow $db $row] } {
> > ns_log Notice "[ns_set get $row type] - [ns_set get $row desc]"
> > }
> >
> > The problem is that the code in admin_op does not work, I get this error:
> > can't read "db": no such variable
> > while executing
> > "ns_db select $db "select * from tadminoptype;""
> >
> > But if I put this code in the db.tcl file, then it works fine.
> >
> > Can someone tell me if some settings are wrong, or if I am using ns_db
> > incorrectly?
> >
> > Thank you
> >
> >
> >
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>
--
Xavier Bourguignon
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.