|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
you were right with the php/mysql =] and how would i use the timestamp option =[
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
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. |
|
#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 ...
|
|
#7
|
|||
|
|||
|
thx ive solved the problem =]
i added as a variable PHP Code:
then counted +1 for each row which i put at the end of my while statement PHP Code:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > timestamping |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|