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

version» Context lines:

Roxen.git/server/modules/tags/sqltag.pike:1:   /* -  * $Id: sqltag.pike,v 1.33 1998/11/04 21:12:14 grubba Exp $ +  * $Id: sqltag.pike,v 1.34 1999/05/14 08:03:19 neotron Exp $    *    * A module for Roxen Challenger, which gives the tags    * <SQLQUERY> and <SQLOUTPUT>.    *    * Henrik Grubbström 1997-01-12    */    - constant cvs_version="$Id: sqltag.pike,v 1.33 1998/11/04 21:12:14 grubba Exp $"; + constant cvs_version="$Id: sqltag.pike,v 1.34 1999/05/14 08:03:19 neotron Exp $";   constant thread_safe=1;   #include <module.h>      /* Compatibility with old versions of the sqltag module. */   // #define SQL_TAG_COMPAT      inherit "module";   inherit "roxenlib";      import Array;
Roxen.git/server/modules/tags/sqltag.pike:164:    contents = ("<h3>Query \"" + html_encode_string(args->query)    + "\" failed: " + html_encode_string(con->error())    + "</h1>\n<false>");    } else {    contents = "<false>";    }    } else if (result && sizeof(result))    {    contents = do_output_tag( args, result, contents, request_id )    + "<true>"; +  +  if( args["rowinfo"] ) +  request_id->variables[args->rowinfo]=sizeof(result); +     } else {    contents = "<false>";    }    } else {    contents = "<!-- No query! --><false>";    }    return(contents);   }      string sqlquery_tag(string tag_name, mapping args,
Roxen.git/server/modules/tags/sqltag.pike:379:    }    res += "><tr>";    foreach(map(result->fetch_fields(), lambda (mapping m) {    return(m->name);    } ), string name) {    res += "<th>"+name+"</th>";    }    res += "</tr>\n";    }    +  if( args["rowinfo"] ) +  request_id->variables[args->rowinfo]=result->num_rows(); +     while (row = result->fetch_row()) {    if (ascii) {    res += (Array.map(row, lambda(mixed value) {    return((string)value);    }) * "\t") + "\n";    } else {    res += "<tr>";    foreach(row, mixed value) {    value = (string)value;    res += "<td>"+(value==""?nullvalue:value)+"</td>";