[Mediawiki-l] Problems with SQL2wiki extension in template

Jan Steinman Jan at Bytesmiths.com
Tue Jul 7 16:22:31 UTC 2009


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?





More information about the MediaWiki-l mailing list