Jump to content

Recommended Posts

Hi there,

 

yesterday, in my shop, the ability to change products description, etc. just stopped working. I have no idea what caused this problem.. I managed to catch this error:

Db->executeS() must be used only with select, show, explain or describe queries

 

Can anyone please help and tell me what to do?

 

Thanx in advance

Edited by dzoxen (see edit history)
Link to comment
Share on other sites

You could try to find out what query causes this error.

 

The error message comes from \classes\db\db.php.

There on about line 467 (in 1.5.6.1) you will find the function executeS().

 

My suggestion is to change the following part

if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc)\s#i', $sql))
{
	if (defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)
		throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
	return $this->execute($sql, $use_cache);
}

into

if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc)\s#i', $sql))
{
	if (defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)
	{	echo "<p>".$sql."<p>";
		throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
	}
	return $this->execute($sql, $use_cache);
}

This should show the sql query that produces the error. If you share that query here we can probably tell more.

Link to comment
Share on other sites

  • 8 months later...
×
×
  • Create New...