php - creating a post subsciber system -


i'm sorry title might sound ambiguous, here's deal. need able , manage database table has users id along topic preferences. topic preference topics user interested in.

basic background info

the reason doing because have android mobile application pull data database through php , json, app should able show 'relevant posts' user has subscribed to.

how thought of implementing was

  1. option a

    to have table have 2 fields in id stored alongside topic preferences. preferences contain strings of topics , pulled , separated via dash or comma.

    update preference i'd pull string , either append new preference or delete mention of topic wanted rid of.

    view topic(on android phone) i'd filter dataset on android phone depending on whether selected preference string contains mention of topic display them.

  2. option b

    the other way of implementing thought have same table contain userid , subsequent fields have header name of topic wanted show.

    this allow me alter visibility specific user through 0's,1's , 2's 0 means user has subscribed , 1 meaning user hasn't , 2 meaning aren't allowed view it.


actually, i'm totally new database manipulation , coding java , php. i'm not sure whether there exists better method implement above , that's why i'm asking. also, know of arrays. how apply relevantly feature want implement.


Comments