A PHP Error was encountered

Severity: Notice

Message: Trying to get property 'id' of non-object

Filename: controllers/Frontend_productos.php

Line Number: 46

Backtrace:

File: /home/sulazzre/public_html/pas/application/controllers/Frontend_productos.php
Line: 46
Function: _error_handler

File: /home/sulazzre/public_html/pas/index.php
Line: 292
Function: require_once

Database Error

A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER by p.update DESC LIMIT 6' at line 13

select p.id, cat.nombre as categoria, cat.url as categoria_url, p.titulo, p.cuerpo, p.url, p.url_custom, p.publicacion, p.precio, p.descuento, p.stock, p.portada, p.portada_orden, p.oferta, p.oferta_inicio, p.oferta_cierre, p.oferta_ilimitada, p.estado, CASE WHEN date_format(curdate(), "%Y-%m-%d") BETWEEN p.oferta_inicio AND p.oferta_cierre THEN 1 ELSE 0 END AS oferta_vigente, (select f.url from files as f where f.id_producto = p.id ORDER BY f.id ASC LIMIT 1) as img_default, (select f.url from files as f where f.id_producto = p.id and f.destacada = 1 LIMIT 1) as img_star FROM productos AS p LEFT JOIN categorias AS cat ON p.id_categoria = cat.id WHERE cat.url="internals" and p.id != ORDER by p.update DESC LIMIT 6;

Filename: models/Productos_model.php

Line Number: 159