Updated 2014-08-22 09:18:22 by NickyQcode

MainHome PageSource Code Downloads API Documentation Mailing ListsBugs Developers

ns_db dml edit

Tcl example of database connection using ns_db dml.
ns_register_proc GET /index.html db_test_dml

proc db_test_dml {} {
    set pool "main"
    set db [ns_db gethandle $pool]

    set sql "INSERT INTO users(user_id, firstname, surname, email)
             VALUES(1, 'Jane', 'Doe', '[email protected]')"
    ns_db dml $db $sql

    ns_db releasehandle $db


ns_db dml is normally used for INSERT, UPDATE and DELETE queries.