SELECT
p.name as product_name,
i.id,
i.product_id,
i.pic_number,
i.description,
i.type
FROM
bdi_products p,
bdi_product_pictures i
WHERE
p.id = AND
i.product_id = p.id
ORDER BY
i.pic_numberrtvQry_productPicturesByProductID(): SQL Error - 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
i.product_id = p.id
ORDER BY
i.pic_number' at line 12.