Copied! Copy Stacktrace Search Stackoverflow Search Google Exception

Database Exceptionyii\db\Exception

SQLSTATE[42000]: Syntax error or access violation: 1064 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 listing.listing_type_id DESC, RAND(18939)
LIMIT 10000 OFFSET' at line 5
The SQL being executed was: SELECT listing.* FROM `favourite_listings`
INNER JOIN listing on listing.listing_id = favourite_listings.listing_id
WHERE
listing.approved = 1 AND listing.active = 1
AND favourite_listings.user_id= ORDER BY listing.listing_type_id DESC, RAND(18939)
LIMIT 10000 OFFSET 0

Error Info: Array
(
    [0] => 42000
    [1] => 1064
    [2] => 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 listing.listing_type_id DESC, RAND(18939)
										LIMIT 10000 OFFSET' at line 5
)