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.47 2000/02/24 03:54:00 nilsson Exp $"; + constant cvs_version="$Id: sqltag.pike,v 1.48 2000/02/25 01:33:50 nilsson Exp $";   constant thread_safe=1;   #include <module.h>      // Compatibility with old versions of the sqltag module.   // #define SQL_TAG_COMPAT      inherit "module";   inherit "roxenlib";      Configuration conf;
Roxen.git/server/modules/tags/sqltag.pike:43: Inside #if defined(manual)
  <attr name=host type=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>    The actual SQL-statement.   </attr>    - <attr name=quiet> -  Do not show any errors in the page, in case the query fails. - </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.
Roxen.git/server/modules/tags/sqltag.pike:69: Inside #if defined(manual)
  <attr name=host type=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>    The actual SQL-statement.   </attr>    - <attr name=quiet> -  Do not show any errors in the page, in case the query fails. - </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>    Set form-variable to the insert id used by Mysql for    auto-incrementing columns. Note: This is only available with Mysql.   </attr>   "]);
Roxen.git/server/modules/tags/sqltag.pike:140:   #else    if (args->host)    host=args->host;       if(sql_connect)    error = catch(con = sql_connect(host));    else    error = catch(con = Sql.sql(lower_case(host)=="localhost"?"":host));   #endif    -  if (error && !args->quiet) +  if (error)    RXML.run_error("Couldn't connect to SQL server. "+html_encode_string(error[0]));       if (error = catch(result = tag=="sqltable"?con->big_query(args->query):con->query(args->query))) {    error = html_encode_string(sprintf("Query %O failed. %s", args->query,    con->error()||"")); -  if (!args->quiet) +     RXML.run_error(error);    }       if(tag=="sqlquery") args["dbobj"]=con;    return result;   }         // -------------------------------- Tag handlers ------------------------------------   
Roxen.git/server/modules/tags/sqltag.pike:177:       if( args["rowinfo"] )    id->variables[args->rowinfo]=sizeof(res);       return ret;    }       if (args["do-once"])    return do_output_tag( args, ({([])}), contents, id )+ "<true>";    -  if(args->quiet) return ""; +     RXML.run_error("No SQL return values.");   }      class TagSqlplugin {    inherit RXML.Tag;    constant name = "emit";    constant plugin_name = "sql";       array get_dataset(mapping m, RequestID id) {    array|string res=do_sql_query("sqloutput", m, id);
Roxen.git/server/modules/tags/sqltag.pike:251:    }    }       if (!ascii)    ret=make_container("table", args-(["host":"", "database":"", "user":"", "password":"",    "query":"", "nullvalue":""]), ret);       return ret+"<true>";    }    -  if(args->quiet) return ""; +     RXML.run_error("No SQL return values.");   }         // ------------------- Callback functions -------------------------      Sql.sql sql_object(void|string host)   {    string host = stringp(host)?host:query("hostname");    Sql.sql con;