]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FSqlResultPlugin
function _PageList_Column* are not private
[SourceForge/phpwiki.git] / pgsrc / Help%2FSqlResultPlugin
1 Date: Fri,  7 Dec 2012 14:58:45 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0)
3 Content-Type: application/x-phpwiki;
4   pagename=Help%2FSqlResultPlugin;
5   flags=PAGE_LOCKED;
6   markup=2;
7   charset=UTF-8
8 Content-Transfer-Encoding: binary
9
10 The **~SqlResult** [[Help:WikiPlugin|plugin]] displays results of arbitrary SQL select statements in table form.
11
12 The database definition, the DSN, must be defined in the local file ##config/SqlResult.ini##
13
14 A simple textfile with alias = dsn lines.
15
16 Optional template file to format the result and handle some logic.
17
18 Template vars: %%where%%, %%sortby%%, %%limit%%
19
20 == Usage ==
21 {{{
22 <<SqlResult parameters
23 SELECT statement
24 >>
25 }}}
26
27 == Arguments ==
28
29 {| class="bordered"
30 |-
31 ! Argument
32 ! Description
33 ! Default value
34 |-
35 | **alias**
36 | DSN database specification
37 | false
38 |-
39 | **ordered**
40 | if to display as {{{<ol>}}} list: single col only without template
41 | false
42 |-
43 | **template**
44 | use a custom {{{<theme>/template.tmpl}}}
45 | false
46 |-
47 | **where**
48 | custom filter for the query
49 | false
50 |-
51 | **sortby**
52 | for paging
53 | false (no paging)
54 |-
55 | **limit**
56 | for paging
57 | 0,50 (only the first 50)
58 |}
59
60 == Examples ==
61
62 {{{
63 <<SqlResult alias=mysql
64          SELECT 'mysql password for string "xx":',
65                 PASSWORD('xx')
66 >>
67
68 <<SqlResult alias=videos template=videos
69          SELECT rating,title,date
70                 FROM video
71                 ORDER BY rating DESC
72                 LIMIT 5
73 >>
74
75 <<SqlResult alias=imdb template=imdbmovies where||="Davies, Jeremy%"
76 SELECT m.title, m.date, n.name, c.role
77   FROM movies as m, names as n, jobs as j, characters as c
78   WHERE n.name LIKE "%%where%%"
79   AND m.title_id = c.title_id
80   AND n.name_id = c.name_id
81   AND c.job_id = j.job_id
82   AND j.description = 'Actor'
83   ORDER BY m.date DESC
84 >>
85 }}}
86
87 == Author ==
88 * [[Help:Reini Urban|Reini Urban]]
89
90 == See Also ==
91
92 <noinclude>
93 ----
94 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]
95 </noinclude>