Jump to content

Getting an array from a table with PHP and MySql


pixelz

Recommended Posts

Hey,

TL:DR: The goal I want to achieve is getting statuses from a user's friends w/ an array of friends..

 

Things already set up:

  Table for statuses - id(an incremental thing to count), osid(what post, to allow comments), author, user_id(the author's id), type[a,b] (a   is a post, b is a comment) and postdate.

 

  Table for friends - id(incremental), user1(person that initiated the friendship), user1_id(that person's id), user2(person that accepts the friendship), user2_id(his id), datemade 

 

What needs to happen is create an array of all a user's friends pseudo code:

"Select user2_id where user1_id is logged_in_user_id"

"friends[] = loop(mysql query until no more)"

"loop:Select statuses where user_id is friends"

"Populate my screen with statuses"

 

I know this is bad pseudo code but please help me put together a working system!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.