SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Activity logger

  1. #1
    SitePoint Addict eanimator's Avatar
    Join Date
    Sep 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Activity logger

    Hello,

    I need to know this:

    Best way to develop

    RECENT ACTIVITY LOG

    Tom wrote on John's Wall.
    Tom likes Munim's photo.
    Tom and Munim are now friends.


    would it be fine to construct a string "Tom wrote on John's Wall." at the time of insertion? or else I have to do Table JOINS everytime I want to display activities

    Here is my table structure:
    PHP Code:
    CREATE TABLE `user_activity` (
      `
    activityIDint(11NOT NULL auto_increment,
      `
    activity_typeint(11NOT NULL,
      `
    recordIDint(11NOT NULL,
      `
    hostuserIDint(11NOT NULL,
      `
    targetuserIDint(11NOT NULL,
      `
    activity_datedatetime NOT NULL,
      `
    activityvarchar(255NOT NULL,
      
    PRIMARY KEY  (`activityID`),
      
    KEY `recordID` (`recordID`),
      
    KEY `userID` (`hostuserID`),
      
    KEY `activity_type` (`activity_type`)
    ENGINE=MyISAM 
    activity = constructed string.

    Awaiting your response.

    Thanks in advance

  2. #2
    SitePoint Zealot Kayarc's Avatar
    Join Date
    Sep 2009
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by eanimator View Post
    Hello,

    I need to know this:

    Best way to develop

    RECENT ACTIVITY LOG

    Tom wrote on John's Wall.
    Tom likes Munim's photo.
    Tom and Munim are now friends.


    would it be fine to construct a string "Tom wrote on John's Wall." at the time of insertion? or else I have to do Table JOINS everytime I want to display activities

    Here is my table structure:
    PHP Code:
    CREATE TABLE `user_activity` (
      `
    activityIDint(11NOT NULL auto_increment,
      `
    activity_typeint(11NOT NULL,
      `
    recordIDint(11NOT NULL,
      `
    hostuserIDint(11NOT NULL,
      `
    targetuserIDint(11NOT NULL,
      `
    activity_datedatetime NOT NULL,
      `
    activityvarchar(255NOT NULL,
      
    PRIMARY KEY  (`activityID`),
      
    KEY `recordID` (`recordID`),
      
    KEY `userID` (`hostuserID`),
      
    KEY `activity_type` (`activity_type`)
    ENGINE=MyISAM 
    activity = constructed string.

    Awaiting your response.

    Thanks in advance
    You may get more from the database forum since that seems to be the focus of the question
    Phoenix Arizona Web Design | info *at* kayarc.com | 602.633.2676


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
  •