Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Timestamp
Skywalker
Posted on 22 Sep 2008, 11:59:03

Access: Member
Total Posts: 5
Joined: 2008-06-04

Hello

How is made the timestamp in the table news30_story ?

I try to insert news by using PHP script.

Thanks.
#425
Chris
Posted on 23 Sep 2008, 17:00:45

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

I'm not entirely sure what it is you mean. When you create a new post a timestamp is assigned to it using the PHP time() function.
#430
Skywalker
Posted on 24 Sep 2008, 14:42:34

Access: Member
Total Posts: 5
Joined: 2008-06-04

I've made an SQL request like that :

Code:
INSERT INTO news30_story (title, story, shortstory, author, origauthor, avatar, ip, timestamp, catid, allowcomments, short, approved, id)
VALUES ('Title', .... , UNIX_TIMESTAMP(), .... )

but it doesn't work properly.
#432
Last edited by Skywalker at 2008-09-24 14:43:50 Reason:
Chris
Posted on 25 Sep 2008, 00:02:50

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Quote:
I've made an SQL request like that :

Code:
INSERT INTO news30_story (title, story, shortstory, author, origauthor, avatar, ip, timestamp, catid, allowcomments, short, approved, id)
VALUES ('Title', .... , UNIX_TIMESTAMP(), .... )

but it doesn't work properly.

Try this

Code:
<?php
$time 
= time();
$sq = "INSERT INTO news30_story (title,story,shortstory,author,origauthor,avatar,ip,timestamp,catid,allowcomments,short,approved)
VALUES
('title',......'
$time',......";
$query = mysql_query($sql);
?>


Be careful trying to manipulate the database this way as it's very easy to mess things up. Also note that when inserting a new posts you don't need to specify an ID as that field in the table is set to auto_increment and will assign an ID automatically
#433
Last edited by Chris at 2008-09-25 00:03:33 Reason:
Skywalker
Posted on 25 Sep 2008, 12:27:14

Access: Member
Total Posts: 5
Joined: 2008-06-04

Thanks !
#434
Network-13.com © 2013