Jump to content

dlouis95

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Everything posted by dlouis95

  1. :D :D :D :D :D :D THANK YOU SOO SOOOO SOOOOOOOO MUCH. lol I wish my friends knewmysql more. Thanks you. =)
  2. Hello all. Im making a new site and I've been doing good up until this one part that i never learned how to do. What i need to do is select posts (posts table) where the person that made the post is friends with me (friend table) and I would like it in order of it being made. So far the closest ive gotten in getting this is the code below SELECT * FROM `posts` WHERE `user_id`=(SELECT `friend_id` FROM `friend` WHERE user_id = ' #my id ') But this gave the error that I'm selecting more than one row, which I need to do. Is there any other way I can do this? Any help at all would be greatly appreciated. I'm using Mysql client version 5.1.50.
  3. Ive tryed a new method: "SELECT * FROM `posts` WHERE `user_id`=(SELECT `friend_id` FROM `friend` WHERE user_id = '$user_id')" But this gave me the error that I was selecting more than one row, which I was and need to do. Can anyone help me in trying to make this work? Not just this script but can any one help me in trying to accomplish my goal?
  4. Youve been a huge help but im still haveing alittle problem with this. Can you help me make the following script work? SELECT p.user_id, p.post, p.time FROM posts as p, friend as f WHERE f.user_id = '$user_id' AND p.user_id = 'f.friend_id' ORDER BY p.time DESC LIMIT 10 It all works up until the p.user_id = 'f.friend_id' part. Know how to solve this problem? Thanks for the help in advance.
  5. I'm using MySQL client version: 5.1.48
  6. Hello. I have two tables in a databse, friends and posts. Im trying to select all the posts by my unique number of friends and display them in order all in one mysql query. Is this posible? I know this wouldnt work, but i was thinking it could be something like: SELECT * FROM posts WHERE id ='(SELECT id FROM friends WHERE friend = $me)' How can i make something like this?
×
×
  • 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.