|
Author |
Message |
ZIN
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 28 Aug 2006
Posts: 1
|
Posted:
Mon Aug 28, 2006 2:47 pm (17 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
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. |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by ZIN Find all posts by ZIN](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Aug 28, 2006 6:38 pm (17 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
There's probably something wrong with the timestamp. If you try:
what do you get? |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Mon Aug 28, 2006 10:17 pm (17 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
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... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
|
|
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.118749 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |