
July 12th, 2007, 19:48 PM
|
| Administrator
Join Date: Jun 2007
Posts: 3,709
BRL$: 42,921.40 Thanks: 0
Thanked 14 Times in 10 Posts
Rep Power: 409 | | Complicated mysql query, adding a count() Ok, well I'm making my own forum software because nothing out right now works to what im looking for. Im sure you all know how a forum works because you're here right? Anyways I've got this query right? PHP:---------$query = "SELECT threads.id, threads.subject, categories.name, started.id AS starterid, started.username AS starter, lastreply.id AS lastreplyid, lastreply.username AS lastreply FROM `threads` LEFT JOIN `users` AS started ON started.id = threads.started LEFT JOIN `users` AS lastreply ON lastreply.id = threads.last_reply LEFT JOIN `categories` ON categories.id = threads.category";--------- That displays each thread with the subject, category, the thread starters username and userid, the past person to posts username and their userid. now i need to find out how many posts are under a certain thread. anyone know where i could stick the count() function in that query to figure this out? To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. | |
__________________ █ High Quality To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ Powerful To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. █ Jobs In !!! - Post Jobs, Hire Employees, Create Blogs and
Earn Money. | | | |