
Originally Posted by
izar74
Hi again,
I've got this error:
HTML Code:
[25-May-2015 15:22:01] PHP Fatal error: 1064: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 '2')
OR (p.products_id=p2c.products_id AND prp.scope_id=p2c.categories_id A' at line 3 :: SELECT prp.point_ratio*p.products_price AS reward_points, prp.point_ratio, p.products_price, p.products_priced_by_attribute
FROM reward_master prp, products p, products_to_categories p2c
WHERE p.products_id='101'"'
AND p2c.products_id='101'"'
AND ((prp.scope_id=p.products_id AND prp.scope='2')
OR (p.products_id=p2c.products_id AND prp.scope_id=p2c.categories_id AND prp.scope='1')
OR (prp.scope='0'))
ORDER BY prp.scope DESC LIMIT 1; ==> (as called by) /var/www/vhosts/.../httpdocs/includes/functions/extra_functions/reward_points_functions.php on line 62 <== in /var/www/vhosts/.../httpdocs/includes/classes/db/mysql/query_factory.php on line 155
Check the file but it seem all fine... the line 51 to 62 of reward_points_functions.php look like this:
PHP Code:
if(zen_get_products_price_is_free($products_id)==false || REWARD_POINTS_ALLOW_ON_FREE=='1') // Allow RP on free items (Admin settable)
{
$sql = "SELECT prp.point_ratio*p.products_price AS reward_points, prp.point_ratio, p.products_price, p.products_priced_by_attribute
FROM ".TABLE_REWARD_MASTER." prp, ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c
WHERE p.products_id='" . $products_id . "'
AND p2c.products_id='" . $products_id . "'
AND ((prp.scope_id=p.products_id AND prp.scope='".SCOPE_PRODUCT."')
OR (p.products_id=p2c.products_id AND prp.scope_id=p2c.categories_id AND prp.scope='".SCOPE_CATEGORY."')
OR (prp.scope='".SCOPE_GLOBAL."'))
ORDER BY prp.scope DESC LIMIT 1;";
$result=$db->Execute($sql);
The specific of the server are:
Database: MySQL 5.1.73
Versione PHP: 5.3.3 (Zend: 2.3.0) PHP Memory Limit: 128M
I'm a little bit unsure of what that error could be... any guess would be helpful

I'm getting a similar error. ZC 1.5.6a. fresh installation. Any ideas?
PHP Code:
PHP Fatal error: 1146:Table 'XXX.TABLE_REWARD_MASTER' doesn't exist ::
SELECT prp.point_ratio FROM TABLE_REWARD_MASTER prp WHERE prp.scope='SCOPE_GLOBAL' LIMIT 1; ==>
(as called by) /includes/functions/extra_functions/reward_points_functions.php on line 119
<== in /includes/classes/db/mysql/query_factory.php on line 171.
Bookmarks