Jump to content

Recommended Posts

I have a time stamp in a phpbb table called topic_time

 

$query1 = "Select * FROM phpbb_topics WHERE forum_id = 1 ORDER BY topic_time ASC LIMIT 3  ";

 

How would I convert that topic_time timestamp to a real date from the query?

 

ex:

 

$query1 = "Select * FROM phpbb_topics WHERE forum_id = 1 ORDER BY ".date("Y M D", "topic_time"). "ASC LIMIT 3  ";

 

doesnt seem to work though.

Link to comment
https://forums.phpfreaks.com/topic/71310-convert-time-from-query/
Share on other sites

it is in the phpbb table for the time the topic was posted. I am taking all the topics from the news forum (which is id 1 ) and displaying it on the frontpage, but topic_time is a timestamp, and I want to convert it into a date in the query, so it is ordered by the date.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.