lol, the AND shoudl have been a WHERE (oops)
PHP Code:
if ($_GET['contenttypeid'])
{
$querycontents = $db->query_read("
SELECT erc_content.*, erc_contenttype.contenttype
FROM erc_content
LEFT JOIN erc_contenttype ON erc_content.contentid = erc_contenttype.contenttypeid
WHERE erc_content.contenttypeid = '".$_GET['contenttypeid']."'
ORDER BY erc_contenttype.displayorder, erc_content.displayorder
");
}
else
{
$querycontents = $db->query_read("
SELECT erc_content.*, erc_contenttype.contenttype
FROM erc_content
LEFT JOIN erc_contenttype ON erc_content.contentid = erc_contenttype.contenttypeid
ORDER BY erc_contenttype.displayorder, erc_content.displayorder
");
}
As far as cleaning the $_GET thing, and the table prefixes, that's my next thing to get working... will post completed when i finish it. Thanks Alan!
Paul, i am going to try to do what you said, but I am a little confused, didn't i already build the query as the variable $querycontents?