A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/dessap1/private/main_application/models/artistmodel.php:95)

Filename: codeigniter/Common.php

Line Number: 356

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 'ORDER BY aap.alsoAppearsOn ASC, p.dateRelease DESC' at line 7

SELECT pt.name AS productTypeName, p.id as productID, p.*, aap.alsoAppearsOn, a.name as artistName FROM artist a LEFT JOIN assoc_artist_product aap ON a.id=aap.artistID LEFT JOIN product p ON aap.productID=p.id LEFT JOIN product_type pt ON p.typeID=pt.id WHERE a.id= ORDER BY aap.alsoAppearsOn ASC, p.dateRelease DESC