I'm having trouble using the SQL2wiki extension in a template.
Something seems to be goofy about the use of a parameter. The parameter is not getting the value it is supposed to get, and the MySQL error messages seem to indicate that one of the curly braces is getting stripped off:
Here is the template with as simple a query as I could muster; user_id 2 is a valid record:
<noinclude>{{project timelog1|2}}</noinclude> <includeonly><sql2wiki database="EcoReality">SELECT * FROM
mw_user WHERE user_id = {{{1}}}</sql2wiki></includeonly>
and here is what is produced, error messages in front of an empty table:
Warning: mysql_query() [<a href='http://www.mysql.com/doc'>http://www.mysql.com/doc
</a>]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{{1}}}' at line 1 in [full path deleted]/mediawiki-1.13.3/ extensions/SQL2Wiki.php on line 42
[and three subsequent error messages about invalid result resources]
<!-- start content -->
<table border=1><tr></tr></table>
<!--
I don't understand why this is happening, because it was my impression that the template parameter substitution happens before the extension is invoked. Other templates with parameters on this site are working fine, although no other one contains extension tags with a positional parameter between them. I would have contacted the extension author (or started going through the code) fist except for this impression.
Any clues?
I'm reciving this error or notine: untested generator 'MediaWiki 1.15alpha', expect trouble ahead while importin eswiki-20090615-pages-articles.xml with mwimport perl script, it import all pages, but i don't know whats means this notice, i'm using mediawiki 1.15.0 downloaded from SVN, I berlive the problem is on eswiki-somedate-pages-articles.xml, because i try with other xml and the problem remain. The other trouble is in the place of templates have articles, them i see these article on many other pages.I imported -20090615-pages-articles.xml with mwdumper.jar and the problem with templates continue, when import with whit importDump.php script i recive fatal error related with memory,. i have imported other wikis(eswikisources, eswikilibros with importdump.php ) and work fine all templates are on the rigth place. some one here has imported eswiki-somedate-pages-articles.xml ??????
Hi,
2009/7/7 Jan Steinman Jan@bytesmiths.com:
I'm having trouble using the SQL2wiki extension in a template.
Something seems to be goofy about the use of a parameter. The parameter is not getting the value it is supposed to get, and the MySQL error messages seem to indicate that one of the curly braces is getting stripped off:
Here is the template with as simple a query as I could muster; user_id 2 is a valid record:
<noinclude>{{project timelog1|2}}</noinclude> <includeonly><sql2wiki database="EcoReality">SELECT * FROM mw_user WHERE user_id = {{{1}}}</sql2wiki></includeonly>
and here is what is produced, error messages in front of an empty table:
Warning: mysql_query() [<a href='http://www.mysql.com/doc'>http://www.mysql.com/doc </a>]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{{1}}}' at line 1 in [full path deleted]/mediawiki-1.13.3/ extensions/SQL2Wiki.php on line 42
I have no experience with this extension, but aren't user_id's strings? In that case, the {{{1}}} probably needs some quotes around it.
Jan Steinman wrote:
I don't understand why this is happening, because it was my impression that the template parameter substitution happens before the extension is invoked. Other templates with parameters on this site are working fine, although no other one contains extension tags with a positional parameter between them. I would have contacted the extension author (or started going through the code) fist except for this impression.
Any clues?
Parameters don't work with tag extensions (<tags>). Call as {{#tag: sql2wiki | database=EcoReality | SELECT * FROM mw_user WHERE user_id = {{{1}}} }}
http://www.mediawiki.org/wiki/Manual:Tag_extensions#Extensions_and_Templates
mediawiki-l@lists.wikimedia.org