SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Not Bad, eh? Justin Sampson's Avatar
    Join Date
    Aug 2000
    Location
    N.S., Canada
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    This was bugging me for a while. I'm trying to make my own message board because I can't find one I like and I thought it would be good practice.

    I have two tables, posts and users:

    users
    id | username | password | email | homepage

    posts
    id | user | subject | title | firstmessage | bid | date | editdate | views | sticky

    Then I use this to get a list of all the posts where the boardid = 1, it's the first message, and it isn't sticky:

    select subject, posts.id, users.id, user, username, views, date from posts, users where users.id = 'user' and firstmessage='yes' and sticky = 'N' and bid = '1' order by editdate desc

    But it doesn't return anything. I'm trying to get the posts id, subject, date posted, and the username and id. The user column in the posts table refers to the users table id's.

    Anyone see why it wont work?

    Thanks,
    Justin Sampson
    Last edited by Justin Sampson; Mar 25, 2001 at 07:36.

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you want to replace:

    where users.id = 'user'

    with:

    where users.id = user

  3. #3
    Not Bad, eh? Justin Sampson's Avatar
    Join Date
    Aug 2000
    Location
    N.S., Canada
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! Works like a charm!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •