Topic: Need some help on a sql query

Hey there.
Ok... in order to get the archive script complete i need to fix this.

Can anybody check this topic and help me out with the sql with is use to get the resultset set in the variable $result2.

Basicaly i want to query the db for all the forum names and ids that a guest can read.
I think that needs a left and an inner join. I tryed it out but i not used at all to the usage of join. Could somebody help me?  It's one query roll

Re: Need some help on a sql query

I fixed it. I understand nobody answered, this a tricky one.
In fact, I dont think this is possible to do with pure sql as we are considering a lot of assumptions that don't lie in the stored data itself.
I changed a bit the aplication and got to the solution without sending a load of queries to the database.

Re: Need some help on a sql query

Check how index.php does it? tongue

Re: Need some help on a sql query

It's not exactly the same query. The way my script was made i had to query category by category.
But i will have look. I thought about doing that before, but i wasl lazy :S

Re: Need some help on a sql query

Well, that's the way you coded it. However, you now have 2 + x queries, where x is the number of categories returned by the first query. You could turn it all into one query using the index.php query wink

Re: Need some help on a sql query

Well, first of all thank you for this talk and your tips.

I gave a look at the query on index.php on line 42. It's a long one. At a first look i think i could only change the group_id to 3. But i think i will leave that improvement for later. That would imply some more work in the rest of the code and at the moment i feel more like enjoying the script big_smile. Either efficiently or not it's fully working.

I leave that to a future version of this little module, it can be nice  to a have something to do when i get bored wink