Solved

creating an activity stream using mysql and html

Posted on 2013-01-20
9
1,264 Views
Last Modified: 2013-01-25
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.
0
Comment
Question by:Evan Cutler
  • 4
  • 3
  • 2
9 Comments
 
LVL 26

Expert Comment

by:EddieShipman
ID: 38801168
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38802236
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&
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 38802359
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.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 38802790
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?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 9

Author Comment

by:Evan Cutler
ID: 38802866
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38803041
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&
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 38803130
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?
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 38803139
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 38819869
These got me started...thanks.
my next question is data model development for activity streaming.

Evan
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now