Tried executing this query, but keep getting a database error, 1064
PHP Code:
$pms = $db->query_read("
SELECT pm.*, pmtext.*
" . iif($vbulletin->options['privallowicons'], ", icon.title AS icontitle, icon.iconpath") . "
FROM " . TABLE_PREFIX . "pm AS pm
LEFT JOIN " . TABLE_PREFIX . "pmtext AS pmtext ON(pmtext.pmtextid = pm.pmtextid)
" . iif($vbulletin->options['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "
WHERE pm.userid=$userid AND pm.folderid=$folderid
ORDER BY pmtext.dateline DESC
");
MySQL Error : 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 pmtext.dateline DESC' at line 7
Error Number : 1064