HI

I am using this old version because of compatiobility with my old PHP ver 4.4.0 on which i have developed many web applications. Now i have one problem and i need to solve very quick, this is my query:

SELECT DISTINCT id,rut_id,usr_id,COUNT(city_id) AS sitis,COUNT(acc_id) AS accomo,SUM(days) AS dejs ,SUM(price*days) AS prajs,agree FROM route GROUP BY rut_id HAVING usr_id=$_SESSION[id] AND agree="N" ORDER BY rut_id

This should return all notcompletted tourist routes with calculated price of border and so on.But what is the problem, problem is when one user have many route registered, for some new user who have registered one or two routes this query doesnt return any result, return empty result set.
OK, decide to split this query in 2 separete like this:

SELECT DISTINCT rut_id,usr_id FROM route WHERE usr_id=$_SESSION[id] AND agree='N' ORDER BY rut_id ASC

where i fill some array with all not completted route id,

and

SELECT id,rut_id,usr_id,COUNT(city_id) AS sitis,COUNT(acc_id) AS accomo,SUM(days) AS dejs ,SUM(price*days) AS prajs,agree FROM route GROUP BY rut_id HAVING rut_id=$notcomp[$i] AND usr_id=$_SESSION[id] ORDER BY rut_id
which is inside for loop.

Now, the problem still exist, any suggestions?