|
Author |
Message |
ZIN
Junior WebHelper
Joined: 28 Aug 2006
Posts: 1
|
Posted:
Mon Aug 28, 2006 2:47 pm (17 years, 7 months ago) |
|
Hello.
I'm trying to make a colun at my website that display the recent topics from a specific forum_id.
And then, to display the topic_title and topic_time in this colun.
Everything is ok, the topic_title apears and the link works fine, but the time is not working, it display the default timestamp 1970/1/1 too all the topics in the colun.
I already tried a lot of different things, i'm going to explain what i'm doing:
Code: | // This will make the SQL consult topic_id, topic_title, topic_time
// I rename topic_time to data and set UNIX_TIMESTAMP to topic_time
$resultNovidades = mysql_query("SELECT forum_id, topic_poster, topic_replies, topic_id, topic_title, UNIX_TIMESTAMP(topic_time) AS data FROM phpbb_topics WHERE forum_id = '19' ORDER BY topic_time DESC LIMIT 9", $connection) or die("Não foi possível conectar, erro em Novidades.");
$recordcountNovidades = mysql_num_rows($resultNovidades); |
At my html page i display:
Code: | // gmdate because the GMT -3 from brazil.
<?echo gmdate("l Y m d - H:i:s", $data);?> |
But it apears like it:
Code: | Thursday 1970 01 01 - 00:00:00
topic title |
Now, how can i display the correct date from the first post???
Well, i'm getting crazy haha.
Thanks for the help. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Aug 28, 2006 6:38 pm (17 years, 7 months ago) |
|
There's probably something wrong with the timestamp. If you try:
what do you get? |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Mon Aug 28, 2006 10:17 pm (17 years, 7 months ago) |
|
From the code you posted it's a little unclear what you've done with the MySQL result after the query. You've used $data, but where was that defined? I assume you have something similar to the following?
Code: | $resultNovidades_a = mysql_fetch_assoc($resultNovidades);
$data = $resultNovidades_a['data']; |
|
________________________________ It's turtles all the way down... |
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.239242 seconds :: 19 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |