I got this query :
SELECT ID, toernooinaam, datum, postcode, plaats, formaat, lat, lng, GetDistance(“.$searchLat.”, “.$searchLon.”, lat, lng) AS distance
FROM toernooien
WHERE toernooinaam LIKE ‘%”. $toernooinaam .”%’ AND wekelijks LIKE ‘%”. $wekelijks .”%’ AND spelersaantal LIKE ‘%”. $spelersaantal .”%’ AND beschrijving LIKE ‘%”. $beschrijving .”%’ AND formaat LIKE ‘%”. $formaat .”%’ AND email LIKE ‘%”. $email .”%’ AND aanvang LIKE ‘%”. $aanvang .”%’ AND start LIKE ‘%”. $start .”%’ AND inschrijvingen LIKE ‘%”. $inschrijvingen .”%’ AND pool LIKE ‘%”. $pool .”%’ AND rondes LIKE ‘%”. $rondes .”%’ AND afgerond LIKE ‘%”. $afgerond .”%’ AND site LIKE ‘%”. $site .”%’ AND inschrijven LIKE ‘%”. $inschrijven .”%’ AND maandag LIKE ‘%”. $maandag .”%’ AND dinsdag LIKE ‘%”. $dinsdag .”%’ AND woensdag LIKE ‘%”. $woensdag .”%’ AND donderdag LIKE ‘%”. $donderdag .”%’ AND vrijdag LIKE ‘%”. $vrijdag .”%’ AND zaterdag LIKE ‘%”. $zaterdag .”%’ AND zondag LIKE ‘%”. $zondag .”%’ AND winkelnaam LIKE ‘%”. $winkelnaam .”%’ AND plaats LIKE ‘%”. $plaats .”%’ ORDER BY ID DESC LIMIT 10 OFFSET “. $offset .”
AND (lat BETWEEN “.$y1.” AND “.$y2.”)
AND (lng BETWEEN “.$x1.” AND “.$x2.”)
AND GetDistance(“.$searchLat.”, “.$searchLon.”, lat, lng) < “.($searchRadius/1000);
it gives 0 results
somehow, if i erase the “ORDER BY ID DESC LIMIT 10 OFFSET “. $offset .”” part it gives results, but with the ORDER BY…. it gives 0 results, i’ve read something about a bug others had too, and it sayed i needed to join, but i’m not really advanced in this, i don;t know how to solve it with join. Does anyone have asimple solution?
Can someone please explain what is going on?
Normaly I would think it has something to do with a mistyped something or i just forgot a pohp var, but its just the thing that it works when i leave out the ORDER BY…