[pmwiki-users] Problem displaying MySQL queries

Nicolas Poulain nico.poulain at gmail.com
Wed Nov 16 15:45:12 CST 2011


On a pmwiki-2.2.33, i use a markup to display MySQL queries based on
GET informations like this :
(:StartSQL 01:)
  SELECT COUNT(co_modu) FROM {$?Table} WHERE (interlocuteur='{$?Id}'
OR {$?Typeresp}='{$?Id}')
(:EndSQL 01:)
It works quite fine.

A problem occurs when the result of the query returns a big result(
but yet I can't figure out exactly how big, say 50 000 chars ).
In this case, even if there is normal text around the markup, the
wikitext div comes absolutely empty :

<div id='wikitext'>

Is there a max size or a max time i should set to avoid this problem ?

Thanks for your help.

Here is the markup I use:
# -------------------------------------
Markup('SQL', 'fulltext', '/\(:StartSQL *(\d+):\)*(.+)\(:EndSQL
\1:\)/sie', "SQL('\$2')");
function SQL($SQL) {
  global $MyPmWiki_Hostname, $MyPmWiki_Username, $MyPmWiki_Password,
$MyPmWiki_DBName, $action;
  if (!$dbh = mysql_connect ($MyPmWiki_Hostname, $MyPmWiki_Username,
$MyPmWiki_Password)) return "Connection Error: ".mysql_error();
  if (!mysql_select_db ($MyPmWiki_DBName)) $resultStr = "Error :
    if($result = mysql_query($SQL,$dbh)) {
    while($row = mysql_fetch_row($result)) {
      foreach ($row as $field)
      $resultStr .= "$field";
  else $resultStr = "SQL Error: ".mysql_error();
  return $resultStr;

Nicolas poulain

More information about the pmwiki-users mailing list