php/mysql site… i have admins post news messages. When they log in, i want to show the number of news posts they have posted in total
what is the most efficient way of doing this?
either 1. do a select in the news table by admin and count rows and print this
or
2. every time the admin posts a message increment a counter and store it somewhere in the admin table…
the first one would probably be the easiest. However I put a counter in almost every table that I make anyway, just because you never really know when you’ll need it…
its my feeling its more efficient to just be
select adinNumberOfPosts from admintable where admin = admin
rather than
select * from news where admin = admin
count_rows(query)