SELECT m.*, u.url
FROM menu m
JOIN urls u ON u.ID=m.urlID
WHERE m.parentID = 60 AND m.ID !=
ORDER BY RAND()
LIMIT 3
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY RAND()
LIMIT 3' at line 5