Trying to add a conditional to the following query, but can't quite get it to work... any ideas what i am doing wrong?
PHP Code:
$querycontents = $db->query_read("
SELECT erc_content.*, erc_contenttype.contenttype
FROM erc_content
LEFT JOIN erc_contenttype ON erc_content.contentid = erc_contenttype.contenttypeid
");
if ($_GET['contenttypeid'])
{
$querycontents .= " AND erc_content.contenttypeid = '".$_GET['contenttypeid']."'";
}
$querycontents .= " ORDER BY erc_contenttype.displayorder, erc_content.displayorder";