Updated 2014-08-21 16:22:41 by achisholm

MainHome PageSource Code Downloads API Documentation Mailing ListsBugs Developers

ns_db 1row edit

Tcl example of database connection using ns_db 1row.
ns_register_proc GET /index.html db_test_1row

proc db_test_1row {} {
    set pool "main"
    set sql "select * from users where user_id = 1"
    set db [ns_db gethandle $pool]
    
    set row [ns_db 1row $db $sql]
    
    set html "dbtest_1row: [ns_set array $row]"

    ns_db releasehandle $db

    ns_return 200 text/html $html
}