j'aurais voulu savoir si mysql sur SME 6.0.1 gérait bien les requètes contenant des UNION, car mon interface nget ne veut pas fonctionner entre autre à cause d'une requete contenant des UNION et qui ne veut pas etre exécutée par le serveur....
"You have an error in your SQL syntax near '(SELECT *, UNIX_TIMESTAMP(download_date) AS dldate FROM download WHERE download_' at line 1"
du coup j'enleve les parenthèses....
et là j'ai droit à
You have an error in your SQL syntax near 'UNION (SELECT *, UNIX_TIMESTAMP(download_date) AS dldate FROM download WHERE dow' at line 1
si j'enleve les parenthèses, c'est pareil, et si je teste chaque sélection indépendamment, ca marche niquel!
Pour ceux qui le demanderaient, voici la requete complète :
- Code: Tout sélectionner
(SELECT *, UNIX_TIMESTAMP(download_date) AS dldate
FROM download
WHERE download_status = 2
ORDER BY download_date ASC)
UNION
(SELECT *, UNIX_TIMESTAMP(download_date) AS dldate
FROM download
WHERE download_custom_position > 0
AND (download_status=0 OR download_status = 4)
ORDER BY download_custom_position ASC,
download_post_time ASC)
UNION
(SELECT *, UNIX_TIMESTAMP(download_date) AS dldate
FROM download
WHERE download_custom_position = 0
AND (download_status=0 OR download_status = 4)
ORDER BY download_post_time ASC)
UNION
(SELECT *, UNIX_TIMESTAMP(download_date) AS dldate
FROM download
WHERE download_status != 0
AND download_status != 2
AND download_status != 4
AND download_status != 99
ORDER BY download_date DESC)