Adding LIMIT to the end of a WHERE query in the databasejoin element, e.g.
WHERE {thistable}.`user_id` = {$my->id}
ORDER BY {thistable}.`nextWeek` DESC
LIMIT 1
gets rendered in the wrong order (in front of ORDER BY) and throws an 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 `#__allcards_by_week`.`nextWeek` DESC' at line 7 SQL=SELECT DISTINCT(`#__allcards_by_week`.`id`) AS value, `nextWeek` AS text FROM `#__allcards_by_week` AS `#__allcards_by_week` WHERE `#__allcards_by_week`.`user_id` = 42 LIMIT 1 ORDER BY `#__allcards_by_week`.`nextWeek` DESY.
Same issue when using LIMIT without ORDER BY.
Thanks!
-Alan
WHERE {thistable}.`user_id` = {$my->id}
ORDER BY {thistable}.`nextWeek` DESC
LIMIT 1
gets rendered in the wrong order (in front of ORDER BY) and throws an 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 `#__allcards_by_week`.`nextWeek` DESC' at line 7 SQL=SELECT DISTINCT(`#__allcards_by_week`.`id`) AS value, `nextWeek` AS text FROM `#__allcards_by_week` AS `#__allcards_by_week` WHERE `#__allcards_by_week`.`user_id` = 42 LIMIT 1 ORDER BY `#__allcards_by_week`.`nextWeek` DESY.
Same issue when using LIMIT without ORDER BY.
Thanks!
-Alan