hi there again!

some of you may have read my posting from yesterday (thx to Benjamin Pflugmann, who 
was the only one to reply...).

now my problem is half the way solved. the query looks now like:

"SELECT   X, Y, Z, Name, Ruler, Size, Score, SUM(Score) AS Summe FROM Planetarion 
GROUP BY X, Y HAVING Summe > 100000 AND Summe < 10000000 AND Score > 10000 AND Score < 
500000"

the only (and i hope last) problem is, that only the first planet of a galaxie 
(matching the query) is given out. but the effect of the query should be that _all_ 
planets fitting to the query (not only the first of a galaxie, but all of the galaxie, 
wich match all points) sould be printed out.

of cause, someone could help to solve this.....

thx!

regards,
toby

p.s.: on here i'll quote the post from yesterday, to tell you bout the whole problem:

-------
hi all together!

i'm turning to your mailinglist as last chance to find s.o. helping me with my problem.

the situation is as follows:

i got a table on a mysql-database, queriing it by php4. the table consists of all 
planets of the planetarion.com-system. these information consists of each 3 
coordinates of a planet (x, y and z), identifiing a planet clearly. theese 3 coords 
are written in a int-field, each. other information are the name of the planet, the 
rulers name, the score and the size of the planet. when the first two coords (x and y) 
of 2 planet are equal, the planets belong to the same galaxie. and now the point:

i try queriing the database as follows:

the user inserts some wished dates (the lowest score, the searched planet may have, 
the highest, the highest number of roids and the lowest..) and the number-interval in 
wich the _galaxy-score_ may be included. (means x > galaxy-sore > y). the problem is, 
to query that! the first query is very simple: "SELECT * FROM Planetarion WHERE Score 
> $x AND Score < $y AND Size > $a AND Size < $B". how how you get the galaxie-score 
for that?? the second query alone is very simple, too: "SELECT SUM(Score) as Summe 
FROM $table WHERE X = $x AND Y = $y GROUP BY X, Y". 

_But how to combine both queries???_

i tried getting the first one and process for each elemnt of it the second one... but 
then the resources of my server will get low, when the first query results eg. 300 
elements or more....

i tried asking the german newsgroup and other people i know, using mysql. and you're 
my very last hope to solve this problem....

thank you very much for each help!!

regards,
dotcom
-------

Reply via email to