Revision: 7770
http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7770&view=rev
Author: vargenau
Date: 2010-12-09 19:02:38 +0000 (Thu, 09 Dec 2010)
Log Message:
-----------
Document SqlResult plugin
Modified Paths:
--------------
trunk/pgsrc/Help%2FSqlResultPlugin
Modified: trunk/pgsrc/Help%2FSqlResultPlugin
===================================================================
--- trunk/pgsrc/Help%2FSqlResultPlugin 2010-12-09 18:43:35 UTC (rev 7769)
+++ trunk/pgsrc/Help%2FSqlResultPlugin 2010-12-09 19:02:38 UTC (rev 7770)
@@ -1,4 +1,4 @@
-Date: Fri, 10 Sep 2010 13:46:13 +0000
+Date: Thu, 9 Dec 2010 19:59:28 +0000
Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC1)
X-Rcs-Id: $Id$
Content-Type: application/x-phpwiki;
@@ -8,26 +8,83 @@
charset=UTF-8
Content-Transfer-Encoding: binary
-_short description_
+The **~SqlResult** [[Help:WikiPlugin|plugin]] displays results of arbitrary SQL select statements in table form.
+The database definition, the DSN, must be defined in the local file ##config/SqlResult.ini##
+
+A simple textfile with alias = dsn lines.
+
+Optional template file to format the result and handle some logic.
+
+Template vars: %%where%%, %%sortby%%, %%limit%%
+
== Usage ==
{{{
-<<SqlResult>>
+<<SqlResult parameters
+SELECT statement
+>>
}}}
== Arguments ==
-page _(default: current pagename)_:
- The page to execute upon.
+{| class="bordered"
+|-
+! Argument
+! Description
+! Default value
+|-
+| **alias**
+| DSN database specification
+| false
+|-
+| **ordered**
+| if to display as {{{<ol>}}} list: single col only without template
+| false
+|-
+| **template**
+| use a custom {{{<theme>/template.tmpl}}}
+| false
+|-
+| **where**
+| custom filter for the query
+| false
+|-
+| **sortby**
+| for paging
+| false (no paging)
+|-
+| **limit**
+| for paging
+| 0,50 (only the first 50)
+|}
-== Example ==
+== Examples ==
{{{
-<<SqlResult>>
+<<SqlResult alias=mysql
+ SELECT 'mysql password for string "xx":',
+ PASSWORD('xx')
+>>
+
+<<SqlResult alias=videos template=videos
+ SELECT rating,title,date
+ FROM video
+ ORDER BY rating DESC
+ LIMIT 5
+>>
+
+<<SqlResult alias=imdb template=imdbmovies where||="Davies, Jeremy%"
+SELECT m.title, m.date, n.name, c.role
+ FROM movies as m, names as n, jobs as j, characters as c
+ WHERE n.name LIKE "%%where%%"
+ AND m.title_id = c.title_id
+ AND n.name_id = c.name_id
+ AND c.job_id = j.job_id
+ AND j.description = 'Actor'
+ ORDER BY m.date DESC
+>>
}}}
-<<SqlResult>>
-
== Author ==
* [[PhpWiki:ReiniUrban|Reini Urban]]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|