Roxen.git / server / modules / tags / sqltag.pike

version» Context lines:

Roxen.git/server/modules/tags/sqltag.pike:1:   // This is a roxen module. Copyright © 1997-2000, Roxen IS.   //   // A module for Roxen, which gives the tags   // <sqltable>, <sqlquery> and <sqloutput>.   //   // Henrik Grubbström 1997-01-12    - constant cvs_version="$Id: sqltag.pike,v 1.53 2000/03/30 18:22:26 nilsson Exp $"; + constant cvs_version="$Id: sqltag.pike,v 1.54 2000/03/31 05:20:48 nilsson Exp $";   constant thread_safe=1;   #include <module.h>   #include <config.h>      inherit "module";   inherit "roxenlib";      Configuration conf;      
Roxen.git/server/modules/tags/sqltag.pike:31: Inside #if defined(manual)
   Creates an HTML or ASCII table from the results of an SQL query.   </short>   </desc>      <attr name=ascii>    Create an ASCII table rather than a HTML table. Useful for    interacting with the <ref type=tag>diagram</ref> and <ref    type=tag>tablify</ref> tags.   </attr>    - <attr name=host type=database> + <attr name=host value=database>    Which database to connect to, usually a symbolic name set in the    <module>SQL Databases</module> module. If omitted the default    database will be used.   </attr>    - <attr name=SQL statement> + <attr name=query value='SQL statement'>    The actual SQL-statement.   </attr>      <attribute name=parse>    If specified, the query will be parsed by the RXML parser.    Useful if you wish to dynamically build the query.   </attribute>",      "sqlquery":#"   <desc tag><short>    Executes an SQL query, but doesn't do anything with the    result.</short> This is mostly used for SQL queries that change the    contents of the database, for example INSERT or UPDATE.   </desc>    - <attr name=host type=database> + <attr name=host value=database>    Which database to connect to, usually a symbolic name set in the    <module>SQL Databases</module> module. If omitted the default    database will be used.   </attr>    - <attr name=query type=SQL statement> + <attr name=query value='SQL statement'>    The actual SQL-statement.   </attr>      <attr name=parse>    If specified, the query will be parsed by the RXML parser. Useful if    you wish to dynamically build the query.   </attr>    - <attr name=mysql-insert-id type=form-variable> + <attr name=mysql-insert-id value=form-variable>    Set form-variable to the insert id used by Mysql for    auto-incrementing columns. Note: This is only available with Mysql. -  + </attr>", +  + "emit#sql":#"<desc plugin>Use this source to connect to and +  query SQL databases for information. The result will be available in +  variables named as the SQL columns.</desc> +  + <attr name=host value=database> +  Which database to connect to, usually a symbolic name set in the +  <module>SQL Databases</module> module. If omitted the default +  database will be used.   </attr> - "]); +  + <attr name=query value='SQL statement'> +  The actual SQL-statement. + </attr> + " + ]);   #endif      array|object do_sql_query(string tag, mapping args, RequestID id)   {    string host = query("hostname");    if (args->host) {    host=args->host;    args->host="CENSORED";    }   
Roxen.git/server/modules/tags/sqltag.pike:163:   }      string tag_sqlquery(string tag, mapping args, RequestID id)   {    NOCACHE();       array res=do_sql_query(tag, args, id);       if(args["mysql-insert-id"])    if(args->dbobj && args->dbobj->master_sql) -  id->variables[args["mysql-insert-id"]] = args->dbobj->master_sql->insert_id(); +  RXML.user_set_var(args["mysql-insert-id"], args->dbobj->master_sql->insert_id());    else    RXML.parse_error("No insert_id present.");       id->misc->defines[" _ok"] = 1;    return "";   }      string tag_sqltable(string tag, mapping args, RequestID id)   {    NOCACHE();