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

version» Context lines:

Roxen.git/server/modules/tags/sqltag.pike:1: - /* -  * $Id: sqltag.pike,v 1.40 1999/11/23 14:19:35 grubba Exp $ -  * -  * A module for Roxen Challenger, which gives the tags -  * <sqltable>, <sqlquery> and <sqloutput>. -  * -  * Henrik Grubbström 1997-01-12 -  */ + // This is a roxen module. Copyright © 1997-1999, Idonex AB. + // + // A module for Roxen Challenger, which gives the tags + // <sqltable>, <sqlquery> and <sqloutput>. + // + // Henrik Grubbström 1997-01-12    - constant cvs_version="$Id: sqltag.pike,v 1.40 1999/11/23 14:19:35 grubba Exp $"; + constant cvs_version="$Id: sqltag.pike,v 1.41 1999/12/08 19:28:20 nilsson Exp $";   constant thread_safe=1;   #include <module.h> - #define old_rxml_compat 1 +       // Compatibility with old versions of the sqltag module.   // #define SQL_TAG_COMPAT      inherit "module";   inherit "roxenlib";      import Sql;    - object conf; + Configuration conf;         // Module interface functions      array register_module()   { -  return( ({ MODULE_PARSER|MODULE_PROVIDER, +  return ({ MODULE_PARSER|MODULE_PROVIDER,    "SQL module",    "This module gives the three tags &lt;SQLQUERY&gt;, " -  "&lt;SQLOUTPUT&gt;, and &lt;SQLTABLE&gt;.<br>\n" +  "&lt;SQLOUTPUT&gt;, and &lt;SQLTABLE&gt;.<br>\n", +  0, 1 }); + } +  + TAGDOCUMENTATION + #ifdef manual + constant tagdoc=(["sqltable":"<desc tag>SQL table</desc>", +  "sqlquery":"<desc tag>SQL query</desc>","sqloutput":"<desc cont>SQL output</desc>"]); + /*    "Usage:<ul>\n"    "<table border=0>\n"    "<tr><td valign=top><b>&lt;sqloutput&gt;</b></td>"    "<td>Executes an SQL query, and "    "replaces #-quoted fieldnames with the results. # is "    "quoted as ##. The content between &lt;sqloutput&gt; and "    "&lt;/sqloutput&gt; is repeated once for every row in the "    "result.</td></tr>\n"    "<tr><td valign=top><b>&lt;sqlquery&gt;</b></td>\n"    "<td>Executes an SQL query, but "
Roxen.git/server/modules/tags/sqltag.pike:73:    "<td>If specified, SQL errors will be kept quiet.</td></tr>\n"    "</table></ul><p>\n"    "The &lt;sqltable&gt; tag has an additional attribute "    "<b>ascii</b>, which generates a tab separated table (usefull "    "with eg the &lt;diagram&gt; tag).<p>\n"    "\n"    "<b>NOTE</b>: Specifying passwords in the documents may prove "    "to be a security hole if the module is not loaded for some "    "reason.<br>\n"    "<b>SEE ALSO</b>: The &lt;FORMOUTPUT&gt; tag can be " -  "useful to generate the queries.<br>\n", -  0, -  1 }) ); - } +  "useful to generate the queries.<br>\n" +  */ + #endif      array|string|object do_sql_query(string tag, mapping args, RequestID id)   {    if (!args->query)    return rxml_error(tag, "No query.", id);       if (args->parse)    args->query = parse_rxml(args->query, id);       string host = query("hostname");