Class desconstruct/available resources
View Single Post
04-02-2008, 02:49 AM
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
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,
View Public Profile
Send a private message to delayedinsanity
Visit delayedinsanity's homepage!
Find More Posts by delayedinsanity