Hi,
In my newsitems SQL table I have a field called published,
the value is either 0(not published) and 1(published)
Each article item is published under catogories,
Catogories is another table in the database so in the newsitems there is a colum that references the catogory id
When I do a loop and displays the catogories I now have a query to the newsitems for counting all newsitems that is not published(0) under each catogory.
But lets say I want to get both published and not published,
can I do this with only one query, and do some math instead of having two queries (one for published and one for not published)
eg.
SELECT * from catogories
do loop
SELECT * from newsitems
Find out how many items that has published = 1 and how many that has published = 0
echo "Catogory name (5,1)
//do loop
hope you understood this, and any tips would be of help,
best regards
Thomas