> 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"]

Are you sourcing in db.tcl from admin_op.tcl? Otherwise, how will admin_op.tcl 
know about $db that was set from db.tcl by [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.
> 



      
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
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.

Reply via email to