|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trying to build a forum LOT of questions
I`m only a novice PHP user i have done quite a few simple scripts uploads a very simple chat forum but now i want bigger fish i want to do a real forum with all the bells and wistles. I have quite a bit of it up and working the thing i am stuck on now is my post count here comes the question:
I have my post count working, sort of. It doesnt update every post just per post. I have a counter on the post count so it selects it from my user table updates it and then puts it back and it also puts the new number in the table where my responces go sence this is the only way i could think to do it now. How would i go about printing out the post count for the user and have it update next/under his name every time he posts instead of per post? |
|
#2
|
|||
|
|||
|
RE: Trying to build a forum LOT of questions
There are lots of different approaches to this..here are two of them
1. Have a table that only holds post counts (called postcounts?), then whenever an operation occurs that would update a post count, you update it there. So, if a user posts a message, you increment their post count. If a message gets deleted, you decrement their post count. Then, when displaying messages, just pull the post count from this table. 2. When displaying messages, grab the users point count by counting the actual number of messages in the messages table by them (SELECT count(*) FROM messages WHERE poster='postersname'). This method isn't quite as efficient as the first method and when you get LOTS of messages you could notice a slower response. |
|
#3
|
|||
|
|||
|
RE: Trying to build a forum LOT of questions
I guess you have a table that holds the posted data and in that table say a userid that linkls a record in the post data to a record in the user data. That way you know who made a post and keep the user and post information in separate tables. If this is the case then query the database with something like:
Code:
"SELECT Count([tbluser].[userid]) AS [number_of_posts] FROM [tblposts]; This assumes tbluser holds your user information and tblposts holds your posts data. HTH |
|
#4
|
|||
|
|||
|
RE: Trying to build a forum LOT of questions
NvM i just woke up when i read that and the words all burrled together heh i will have more questions soon i`m sure so i`ll just post them in this topic. Thank you everyone i`ll see how this stuff works soon
|
|
#5
|
|||
|
|||
|
RE: Trying to build a forum LOT of questions
ok i had made it this far already my next step is displaying the information though. I am using a do, while to display the user name avatar and message to the public. How do i get the post count to show up for every user that responds? i could get it to do it if only one user responds to a topic... This is where I am stuck. I probably should have done a better job of explaining earlier
|
|
#6
|
|||
|
|||
|
RE: Trying to build a forum LOT of questions
Never mind i got it woo whoo
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Trying to build a forum LOT of questions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|