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 September 6th, 2003, 12:44 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
timestamping

how would you go about timestamping or giving a unique id for something that is posted...because i made a news system with comments and am wondering how to put a # for everyone that posts comments ...ie

#1 posted by Jon doe
hello everyone

any suggestions

Reply With Quote
  #2  
Old September 6th, 2003, 06:47 PM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
As you neglected to mention what technologies / programming languages you are using, I will have to guess that you are using PHP and probably MySQL.

If you are using MySQL take note that any record in the database with a field of type 'timestamp' has the ability to auto stamp itself.

When you update or add a record, that record's first timestamp field will update itself to the current date and time. Do not attempt to write to that field or you can insert a null value there... same effect.

Hopefully this is what you were looking for.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #3  
Old September 6th, 2003, 07:24 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
you were right with the php/mysql =] and how would i use the timestamp option =[

Reply With Quote
  #4  
Old September 6th, 2003, 07:41 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
im sorry i think what i was trying to say is how would i count the rows...so this row is row 1 and it displays row 1 this is row 2

ie.
1
2
3

would i use arrays?

ive made a news script with comments but all the comments get entered into one mysql database, so some comments come out #4 when its supposed to be #1, because i used the id from the table, to count....

Last edited by Bruski : September 6th, 2003 at 07:44 PM.

Reply With Quote
  #5  
Old September 6th, 2003, 07:53 PM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
So, are you saying that you have an autoincrement field in this table?

Are you using that autoincrement field to display a number by each comment?

Are you numbering comments by topic? If so you will need to use more than your autoincrement field.

Let me know how you have things structured so I can be more helpful to you.

Reply With Quote
  #6  
Old September 6th, 2003, 08:15 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
sorry =[....i have news...i click on comments and that comments goes to the id of the news or news_id...then i post the comments to news_comments tbl....pretty much the second thing you said...numbering by topic ...

Reply With Quote
  #7  
Old September 7th, 2003, 06:48 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
thx ive solved the problem =]
i added as a variable

PHP Code:
 $commentNumber1


then counted +1 for each row which i put at the end of my while statement

PHP Code:
++$commentNumber

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > timestamping


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 1 hosted by Hostway