A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: controllers/productos.php

Line Number: 490

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: controllers/productos.php

Line Number: 491

Database Error

A Database Error Occurred

Error Number: 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 ') AND ip.idproducto<> GROUP BY ip.idproducto ORDER BY numVeces DESC ' at line 8

SELECT ip.idproducto , count(ip.idproducto) as numVeces FROM items_pedido ip WHERE ip.idpedido IN ( SELECT ip2.idpedido FROM items_pedido ip2 WHERE ip2.idproducto = ) AND ip.idproducto<> GROUP BY ip.idproducto ORDER BY numVeces DESC LIMIT 0,4