Difference between revisions of "SQLAllNames"
From Sega Retro
(Created page with "<includeonly>{{#vardefine:namefield|{{{1|}}}}}{{#cargo_query: table=localisednames |fields=localisedname |where=pagename="{{{2|}}}" |limit=10000 |format=template |template=SQL...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#vardefine:namefield|{{{1|}}}}}{{#cargo_query: | + | <includeonly>{{#vardefine:namefield|{{{1|}}}}}{{#vardefine:results|{{#sub:{{#cargo_query: |
table=localisednames | table=localisednames | ||
|fields=localisedname | |fields=localisedname | ||
|where=pagename="{{{2|}}}" | |where=pagename="{{{2|}}}" | ||
|limit=10000 | |limit=10000 | ||
+ | |default= | ||
|format=template | |format=template | ||
|template=SQLAllNames/Cargo | |template=SQLAllNames/Cargo | ||
− | }}</includeonly><noinclude> | + | }}|0|-3}}}}{{#var:namefield}}="{{{2|}}}" {{#if:{{#var:results}}|OR {{#var:results}}}}{{clearvar|namefield}}</includeonly><noinclude> |
Template for handling localised names in SQL queries | Template for handling localised names in SQL queries | ||
− | + | ==Examples== | |
<pre>{{SQLAllNames|name|The Jungle Book}}</pre> | <pre>{{SQLAllNames|name|The Jungle Book}}</pre> | ||
{{SQLAllNames|name|The Jungle Book}} | {{SQLAllNames|name|The Jungle Book}} | ||
+ | |||
+ | e.g. | ||
+ | <pre>{{SQLAllNames|name|Sonic the Hedgehog (Mega Drive)}}</pre> | ||
+ | |||
+ | {{SQLAllNames|name|Sonic the Hedgehog (Mega Drive)}} | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 10:35, 7 May 2022
Template for handling localised names in SQL queries
Examples
{{SQLAllNames|name|The Jungle Book}}
name="The Jungle Book" OR name="Das Dschungelbuch" OR name="El Libro de la Selva" OR name="Il Libro Della Giungla" OR name="Le Livre de la Jungle" OR name="O livro da Selva"
e.g.
{{SQLAllNames|name|Sonic the Hedgehog (Mega Drive)}}
name="Sonic the Hedgehog (Mega Drive)"