excelsior9
Programmer
Ok,
So I've got this UNION query running:
$query = "SELECT id,title,authorcomments,author,keywords,date_format(postdate, '%W %M %D, %Y') AS readable_date FROM artwork
WHERE authorcomments LIKE '%$trimmed%' OR title LIKE '%$trimmed%' OR keywords LIKE '%$trimmed%'
UNION SELECT id,title,poemtext,authorcomments,author,keywords,date_format(postdate, '%W %M %D, %Y') AS readable_date FROM poems
WHERE authorcomments LIKE '%$trimmed%' OR title LIKE '%$trimmed%' OR keywords LIKE '%$trimmed%' ORDER BY postdate DESC";
... but with that ORDER BY clause, I get this error message:
"unknown column 'postdate' in 'order' clause", but obviously there IS a postdate column being queried ...
Any ideas?
So I've got this UNION query running:
$query = "SELECT id,title,authorcomments,author,keywords,date_format(postdate, '%W %M %D, %Y') AS readable_date FROM artwork
WHERE authorcomments LIKE '%$trimmed%' OR title LIKE '%$trimmed%' OR keywords LIKE '%$trimmed%'
UNION SELECT id,title,poemtext,authorcomments,author,keywords,date_format(postdate, '%W %M %D, %Y') AS readable_date FROM poems
WHERE authorcomments LIKE '%$trimmed%' OR title LIKE '%$trimmed%' OR keywords LIKE '%$trimmed%' ORDER BY postdate DESC";
... but with that ORDER BY clause, I get this error message:
"unknown column 'postdate' in 'order' clause", but obviously there IS a postdate column being queried ...
Any ideas?