On one of my sites I get the following warning everytime I clean the site cache:
[tt]
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /media/sda4/www/serhumano/manager/processors/cache_sync.class.processor.php on line 144
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /media/sda4/www/serhumano/manager/processors/cache_sync.class.processor.php on line 160[/tt]
I checked that file and these are the relevant code blocks:
// WRITE snippets to cache file
$sql = "SELECT ss.*,sm.properties as 'sharedproperties' ".
"FROM $dbase.".$table_prefix."site_snippets ss ".
"LEFT JOIN $dbase.".$table_prefix."site_modules sm on sm.guid=ss.moduleguid ";
$rs = mysql_query($sql);
$limit_tmp = mysql_num_rows($rs);
$tmpPHP .= '$s = &$this->snippetCache;' . "\n";
for ($i_tmp=0; $i_tmp<$limit_tmp; $i_tmp++) {
$tmp1 = mysql_fetch_assoc($rs);
$tmpPHP .= '$s[\''.mysql_escape_string($tmp1['name']).'\']'." = '".$this->escapeSingleQuotes($tmp1['snippet'])."';\n";
// Raymond: save snippet properties to cache
if ($tmp1['properties']!=""||$tmp1['sharedproperties']!="") $tmpPHP .= '$s[\''.$tmp1['name'].'Props\']'." = '".$this->escapeSingleQuotes($tmp1['properties']." ".$tmp1['sharedproperties'])."';\n";
// End mod
}
// WRITE plugins to cache file
$sql = "SELECT sp.*,sm.properties as 'sharedproperties' ".
"FROM $dbase.".$table_prefix."site_plugins sp " .
"LEFT JOIN $dbase.".$table_prefix."site_modules sm on sm.guid=sp.moduleguid " .
"WHERE sp.disabled=0";
$rs = mysql_query($sql);
$limit_tmp = mysql_num_rows($rs);
$tmpPHP .= '$p = &$this->pluginCache;' . "\n";
for ($i_tmp=0; $i_tmp<$limit_tmp; $i_tmp++) {
$tmp1 = mysql_fetch_assoc($rs);
$tmpPHP .= '$p[\''.mysql_escape_string($tmp1['name']).'\']'." = '".$this->escapeSingleQuotes($tmp1['plugincode'])."';\n";
if ($tmp1['properties']!=""||$tmp1['sharedproperties']!="") $tmpPHP .= '$p[\''.$tmp1['name'].'Props\']'." = '".$this->escapeSingleQuotes($tmp1['properties']." ".$tmp1['sharedproperties'])."';\n";
}
Apparently this has something to do with shared properties with modules, but I don’t know where to look for answers as I don’t use shared module parameters.
Did anyone get these same warnings?
I’m afraid this can be the start of many other problems so I’d like to sort this out before going live with the site.
I guess it’s not related, but this is the same site as mentioned in
this post. This happens both on local and production installs though.
Thank you for any clues you may have,
JP