Conf/Examples/DatabseExampleDml

From AOLserver Wiki
Jump to navigation Jump to search

part of AOL Database Configuration with PostgreSQL

<html>
   <head><title>Testing of Database connection</title></head>
 <body>  
 A simple tcl script example of Database Configuration
 <% 
  set pool "postgres_pool"
  
  set sql "insert into users(name,email,address) 
  values('jain','jain@qcode.co.uk','Main Road')"    
  
  set db [ns_db gethandle $pool]
  ns_db dml $db $sql
  
  ns_db releasehandle $db
 %>
 </body>
 </html>

Note

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