Did you test the query outside of MODx?
I see a ’ character after fullname that probably doesn’t belong there.
Also, just a tip: use the handy heredoc syntax for multiline-strings/variables.
$sql =<<<YOYOYO
SELECT u.company, u.website, u.comment, u.address, u.city, u.state, u.zip, u.fullname, u.phone, u.fax, u.mobilephone, u.email
FROM $wua AS u
LEFT JOIN $wg AS w ON u.id = w.webuser
LEFT JOIN $wgn AS n ON n.id = w.webgroup
WHERE u.type = 1
AND u.company LIKE '%whatever%'
OR u.type = 1
AND n.name LIKE '%whatever%'
ORDER BY u.company ASC;
YOYOYO
instead of $sql .= "blah"; etc.