Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
adding # of comments to table
Old 05-03-2006, 08:35 PM adding # of comments to table
one
Experienced Talker

Posts: 44
Trades: 0
i'm working on a site that has downloads.i have added a comment mod to the script.
i have a comments table.how can i add # of comments to the files table?
one is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-04-2006, 01:31 AM Re: adding # of comments to table
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
There are two reasonable approaches.
1. Every time you show a single file or a listing of files "select count(*) from comments where file_id = ... " for single file or "... where file_id in (...)" for a listing of files with further numbers assignment within php.
2. Every time a user adds a comment "update files set comments_count = comments_count + 1 wher file_id = ...", but first you will have to count numver of comments that already exists.
The second way is less resource-consuming, but needs more attention while being implemented not to lose some comments if done unproperly.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-04-2006, 08:23 AM Re: adding # of comments to table
one
Experienced Talker

Posts: 44
Trades: 0
thanks for replying,but i dont understand what you said.
my knowledge of sql is somewhat limited.
one is offline
Reply With Quote
View Public Profile
 
Old 05-04-2006, 08:35 AM Re: adding # of comments to table
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Did you do all the coding yourself?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-04-2006, 11:10 AM Re: adding # of comments to table
one
Experienced Talker

Posts: 44
Trades: 0
no i downloaded it,(pafiledb) and i added the comment mod which needed a sql query to add the comment table.
one is offline
Reply With Quote
View Public Profile
 
Old 05-05-2006, 02:12 AM Re: adding # of comments to table
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Dammit man, I cannot tell you where to add what exactly. You need some basic knowledge of php and mysql to do what you want, because your problem is rather simple.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-05-2006, 09:14 PM Re: adding # of comments to table
one
Experienced Talker

Posts: 44
Trades: 0
sorry now i know what you were saying.
not thinking clear latly.
1.doesn't sound good.
2.there is no comment count in files,hense the reason for the topic.
the php i might be able to do or find out how.
i know some php,but it is mainly editing or copying from other scripts.
one is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to adding # of comments to table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24450 seconds with 12 queries