Hi,
Couldn't get into my old account so my first post on my new account 🙂
Edit: I guess I got into the old account again automatically by email address, funny!
If got a query which works like a charm on my localhost but on the live server it won't work as nice 🙁
SELECT
series.sID AS sID,
series.description AS seriename,
(SELECT sum(images.price) FROM images WHERE images.sID = 1) AS seriestotal,
GROUP_CONCAT(DISTINCT themes.description ORDER BY themes.description ASC SEPARATOR ', ') AS themes,
images.iID,
images.description,
images.filename,
images.price,
GROUP_CONCAT(DISTINCT tags.description ORDER BY tags.description ASC SEPARATOR ', ') AS tags
FROM
series
LEFT JOIN
images ON series.sID = images.sID
LEFT JOIN
tags2img ON images.iID = tags2img.iID
LEFT JOIN
tags ON tags2img.tID = tags.tID
LEFT JOIN
tags2serie ON series.sID = tags2serie.sID
LEFT JOIN
tags AS themes ON tags2serie.tID = themes.tID
WHERE
(series.sID = 1)
GROUP BY
images.iID
ORDER BY
images.iID ASC
The problem is with the subquery
(SELECT sum(images.price) FROM images WHERE images.sID = 1) AS seriestotal
Now on my localhost it returns the sum of all price fields, on the live server it returns NULL as seriestotal but no further errors or anyting. The site and database on my live server are an exact copy of my local site and database.
My local MYSQL version is 5.0.67
On the live server it's 4.1.10
Yet I thought subqueries are support from 4.1 onwards... I've tested another simple query with a subquery on the live server and that works... am I doing some other 4.1 unsupported stuff with the subquery?
Thanx for your help!
Cheers