Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

creating an activity stream using mysql and html

Greetings,

I am trying to create an activity stream using mysql and html.
now, I assume that I would have a sql statement to pull the information from a database...

Now, I have four roles in this application. One of the roles monitors the activity of another, and the last two are independent.

That being said, I already understand that I would need a different SQL logic for each one, however the output dataset would be identical for each one.

How should I approach the relationship with the database?  I have a MVC framework (Laravel) that I'm using to employ PHP.

 Should I build the SQL in the business logic and send to the SQL to the database?  Or should I use a stored procedure at the database end?

I am going to make this stream ajax, so I can prepend the <UL> with more activities if more enters the database.  I also intend to only grab a days' worth of data, and do the "click for more" and append to the end of the <UL>.  Kinda like facebook.

THe reason for this is how I could maintain movement of data as the activity grows.

Thanks.
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

It would be better if you don't assume that everyone knows what an activity stream is and better explain what it is you want. Your request is extremely vague for a general question asking about what technique to use.
Yeah if you give us specifics we might be able to understand what you are trying to do.  Showing us the code you are trying to get working would help.

Cd&
Avatar of Evan Cutler

ASKER

ok...let me back up here....
I need to create an activity stream.
I've been reading about creating activity streams, but having difficulties.

My original question was about creating the output dataset, because I have visit logs, but now I'm being asked about other activities as well.

so, to that effort my working theory was to query the logs to create the activity stream, however, I found myself with so many types of queries that the script would be 10,000 lines long.

I am now thinking of creating an activity table, with all activity, then query what I want, but I'm not still sure how to accomplish that.  I am looking at activitystrea.ms and some others for ideas.

Any wisdom on this would be awesome.
thanks for the time.
From wikipedia: "An activity stream is a list of recent activities performed by an individual, typically on a single website."

Is this what you are describing?
yes....it is...
similar to facebook.
I apologize for the quality of the questions.
I'm not sure I know the right questions to ask yet.

This is the first time I'm dealing with social networking activity.
The place you have to start is with database design. If activities center around individuals, then the id of the individuals needs to be the primary key of the table you drive from.  That table should only contain data about the individuals. Then build supporting tables for activites indexed on the individuals and either a sequence or timestamp.  The primary key can just be an auto increment value.

If there are interactions between activities then all you need is a cross table that associates the keys of the supporting tables.

That is pretty general, but the specifics are very dependent on the nature of the data.

Cd&
Thanks...I have logs in areas spanning the solution that I can use to create the activity.
My question is should I just push all activity to one table? and query the table? or do multiple queries from different tables and join them together?
ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
These got me started...thanks.
my next question is data model development for activity streaming.

Evan