General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 15th, 2003, 08:03 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Forums

hey, first off thanks to kode monkey for helping me with the php highlight...and mostly dlhouston whos been answering 99% of my questions =]...i built a forum script yet im having trouble writing a function on displaying the latest poster and amount of topics for a certain forum...any suggestions on how i can go about doing this...if you want to see my code i can gladly post it =]..thx again...prob will take a long time until someone answers

Reply With Quote
  #2  
Old October 15th, 2003, 08:21 PM
manoloweb manoloweb is offline
Moderated
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Monterrey MX
Posts: 49 manoloweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I don't know how your forums were made, but I'll assume that you have MySQL as your DB.

If that's the case, you could use a couple of extra queries in your code...

select count(id) from posts group by forum

This would be to show how many posts are there for each forum

select description, user, postDateTime from posts where forum=$criteria order by postDateTime desc limit 1

This would be to show the last post from that specific forum.

The way you should use this examples may vary depending how is your current code, but hopefully this could be a start point to determine what you have to do.

Hope it helps.

MG
__________________
The deal is not to know everything, but to know the email of the one who does.

Reply With Quote
  #3  
Old October 15th, 2003, 09:03 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
the thing is i have 3 separate tables for each forums topics and posts....how do i carry the id to display the topic # and etc

Reply With Quote
  #4  
Old October 15th, 2003, 11:57 PM
manoloweb manoloweb is offline
Moderated
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Monterrey MX
Posts: 49 manoloweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
You could use some JOIN, but the easiest way is to use several tables in the same query like this:

select b.description, b.user, a.postDateTime
from posts a, threads b
where a.forum=$criteria
and a.ID=b.postID
order by postDateTime desc
limit 1


It may have not sense, because I don't know your tables, but hopefully you can deduct how to use more than one table in your query.

1.- Select the fields and tell the query which table is each field from
2.- Use alias for the tables to make it easier
3.- Tell the query what is the field that links the two tables


Reply With Quote
  #5  
Old October 16th, 2003, 01:07 AM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
gahh thats a mouth full

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Forums


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT