mysql_query: 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 TB12PT2_Works.Hidden <> 1 ORDER BY TB12PT2_Works.OrderIndex DESC, TB12P' at line 10 in SELECT TB12PT2_Works.ID, TB12PT2_Works.Name, TB12PT2_Works.Title FROM TB12PT2_Works INNER JOIN TB12PT2_Portfolio ON TB12PT2_Portfolio.ID = TB12PT2_Works.Parent WHERE TB12PT2_Works.WorksType = AND TB12PT2_Works.Hidden <> 1 ORDER BY TB12PT2_Works.OrderIndex DESC, TB12PT2_Works.ID