[Mediawiki-l] special vs. standard pages mysql features

aretai aretai aretaiuc at gmail.com
Tue Mar 20 13:51:11 UTC 2007


Hi,

I've got a problem with the display of mysql queries. I was successful
running a query on a standard wikipage through php extension:
http://www.mediawiki.org/wiki/Extension:Runphp as well as sql2wiki:
http://www.mediawiki.org/wiki/Extension:SQL2Wiki.

The result is displayed correctly and there are no problems at all. However
I'd like to create a special page so that users don't see the code (as it
may be potentially dangerous). I tried just to pull the results using
wgOut->addWikiText or addHTML. Then dependant on the method used it was a
query like: <sql2wiki database=\"mydbname\">SELECT page_title FROM
page</sql2wiki> or some variable from php output.

And got errors - displayed below:

*Warning*: mysql_query(): 80 is not a valid MySQL-Link resource in *
/wiki/includes/Database.php* on line *435*

*Warning*: mysql_errno(): 80 is not a valid MySQL-Link resource in *
/wiki/includes/Database.php* on line *660*

*Warning*: mysql_errno(): 80 is not a valid MySQL-Link resource in *
/wiki/includes/Database.php* on line *660*

*Warning*: mysql_errno(): 80 is not a valid MySQL-Link resource in *
/wiki/includes/Database.php* on line *660*

*Warning*: mysql_query(): 80 is not a valid MySQL-Link resource in *
/wiki/includes/Database.php* on line *435*

*Warning*: mysql_errno(): 80 is not a valid MySQL-Link resource in *
/wiki/includes/Database.php* on line *660*

*Warning*: mysql_errno(): 80 is not a valid MySQL-Link resource in *
/wiki/includes/Database.php* on line *660*

*Warning*: mysql_errno(): 80 is not a valid MySQL-Link resource in /*
wiki/includes/Database.php* on line *660*
Unable to free MySQL result

Backtrace:

   - GlobalFunctions.php line 602 calls wfBacktrace()
   - Database.php line 586 calls wfDebugDieBacktrace()
   - Database.php line 1801 calls DatabaseMysql::freeResult()
   - LinkBatch.php line 82 calls ResultWrapper::free()
   - LinkBatch.php line 55 calls LinkBatch::executeInto()
   - Skin.php line 192 calls LinkBatch::execute()
   - Skin.php line 171 calls SkinMonoBook::preloadExistence()
   - SkinTemplate.php line 108 calls SkinMonoBook::initPage()
   - MonoBook.php line 28 calls SkinMonoBook::initPage()
   - SkinTemplate.php line 151 calls SkinMonoBook::initPage()
   - OutputPage.php line 577 calls SkinMonoBook::outputPage()
   - OutputPage.php line 794 calls OutputPage::output()
   - Database.php line 476 calls OutputPage::databaseError()
   - Database.php line 419 calls DatabaseMysql::reportQueryError()
   - Database.php line 806 calls DatabaseMysql::query()
   - Database.php line 825 calls DatabaseMysql::select()
   - JobQueue.php line 47 calls DatabaseMysql::selectRow()
   - Wiki.php line 289 calls MediaWiki::pop()
   - Wiki.php line 247 calls MediaWiki::doJobs()
   - index.php line 124 calls MediaWiki::finalCleanup()

Does anyone know what can cause these problems and how to fix it? Another
solution would be to hide the edit/view source tab for this given page (that
actually runs the code). Is it possible?

Regards,
Aretai


More information about the MediaWiki-l mailing list