04-02-2008, 02:49 AM
|
#2 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Another question, not really relating, but kind of - I'm building a small customer support system for my site, and at the top of each administrative page I list the total posts, total new posts, and total posts awaiting reply (read but not replied).
As of now I have three seperate functions, dbTotalPosts(), dbNewPosts(), dbWaitingPosts(), each doing their own database query (SELECT ticket FROM contact, SELECT ticket FROM contact WHERE new='1', etc). All of them use the same db connection, they're not opening and closing it, so is this okay, or would it be better to do one query (SELECT new, replied FROM contact) and then loop through the results and provide a $count of each row? ($total++, $new++, $replied++, or I guess just $new++, $replied++ $total = $new + $replied)
Thanks in advance,
-m
|
|
|
|