celestine
12-08-2003, 02:48 AM
Hi all,
I want to combine 8 queries into 1 query for my script but I get really weird results.
This is my query:-
$qMain = "SELECT count(a.artist_id) as ArtistCount, count(b.aid) as AvatarCount, count(c.brid) as BrushCount,
count(d.bid) as ButtonCount, count(e.gid) as LayoutCount, count(f.pid) as PngCount, count(g.wid) as WallCount,
count(h.tid) as TempCount
FROM artist a, avatars b, brushes c, buttons d, graphics e, pngs f,
wallpapers g, templates h ";
I would write 8 seperate queries to count each but I wanted to know if its possible to just run 1 query to get the same result.
Running the above query in MySQL 4.0.15, it returns "40784351731200" for all the variables.
Can someone tell me where I had gone wrong? thanks.
I want to combine 8 queries into 1 query for my script but I get really weird results.
This is my query:-
$qMain = "SELECT count(a.artist_id) as ArtistCount, count(b.aid) as AvatarCount, count(c.brid) as BrushCount,
count(d.bid) as ButtonCount, count(e.gid) as LayoutCount, count(f.pid) as PngCount, count(g.wid) as WallCount,
count(h.tid) as TempCount
FROM artist a, avatars b, brushes c, buttons d, graphics e, pngs f,
wallpapers g, templates h ";
I would write 8 seperate queries to count each but I wanted to know if its possible to just run 1 query to get the same result.
Running the above query in MySQL 4.0.15, it returns "40784351731200" for all the variables.
Can someone tell me where I had gone wrong? thanks.