Announcement

Collapse
No announcement yet.

Table and Column Name for Thread and Post Date

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Table and Column Name for Thread and Post Date

    Hmm. Trying to make it so the newest threads appear on my forum home. I got it to work, but I wanted to add the date to. Right now I have

    PHP Code:
    $last10new $DB_site->query("
            SELECT vb3_thread.threadid,vb3_thread.title,vb3_thread.lastpost,vb3_thread.replycount,vb3_thread.views,vb3_thread.postusername,vb3_thread.postuserid,vb3_thread.lastposter
            FROM " 
    TABLE_PREFIX "thread
            WHERE forumid = '31'
            ORDER BY lastpost DESC
            LIMIT 10
        "
    ); 
    What do I need to add to get the date that the thread was created

  • #2
    dateline

    You don't need the table on every column you are selecting since you are only selecting from one table. i.e. vb3_thread.threadid = threadid.

    Comment


    • #3
      oh. so I can just put dateline, and to call it would I would do $last10new[dateline] correct?

      Oh Tubedogg, forgot. I tried calling dateline, I didnt get an error, but I realized that dateline isnt the lastpost dateline. Is it still dateline for the date shown in lastpost column?
      Last edited by Rynthar; Thu 23 Oct '03, 12:09pm.

      Comment


      • #4
        Should be, yes.

        Comment


        • #5
          hmm. how do I call the lastpostdate? I tried vb3_thread.lastpostdate and just lastpostdate...

          Comment


          • #6
            lastpost, like you stated in your last post.

            Comment


            • #7
              when i put lastpostdate or dateline in that phrase, i get a "Unknown column" error. meh. Its weird

              Basically tubedogg, if you go to www.valleyforums.com/forum.php , you'll see on the side we show some of our latest threads. That sidepanel is shown on every page. I want to put on that sidepanel the date the thread was posted. Cant seem to figure out how
              Last edited by Rynthar; Sun 16 Nov '03, 7:56am.

              Comment


              • #8
                the column name is lastpost, not lastpostdate.

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X