Tell database records it can display?

Discussion in 'PHP' started by ost87, Aug 10, 2006.

  1. #1
    Hi Everyone

    This supremeley difficult, or am I wrong?

    I have a CMS system with several different components (such as business directory, classifieds system and forum) , all of which are calling for information from the database.

    I would like to introduce some kind of code that would be linked up to a popup list. Based on the selection in the popup list, some records in the database would be made unavailable to the site.

    I would like to achieve this functionality without modifying any of the components or programming for any of the different components, I just want to add code.

    So, basically what I’m looking for is a piece of code that tells the database what records can be made available ( or unavailable ) to the site. This should be irrespective of the content and programming of the site.

    I’ve attached an image of this functionality, which should give you the conceptual view.

    I really hope that somebody knows how to murder this problem.
     

    Attached Files:

    ost87, Aug 10, 2006 IP
  2. casper

    casper Guest

    Messages:
    181
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't completely understand your problem, but to me it looks you really need to add a boolean value. If the system cannot find diversity in the records it would be really difficult to let this work.
     
    casper, Aug 10, 2006 IP
  3. ost87

    ost87 Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi and thanks for your response

    Basically, what I want is a piece of code that tells the database which records it can make available to the site. The site would then only operate on the subset of this information.

    The search string will be based on certain parameters ( but I'm not to worried about that at the moment).

    Thanks for your input
     
    ost87, Aug 10, 2006 IP
  4. rosytoes

    rosytoes Peon

    Messages:
    230
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I don't think you can do it without modifying any existing codes. This is what I would do but it involves changing any queries that you may have in all your modules. Find any query and add a $condition at the end of it like so, $query="select * from <table> where field='$var' ".$condition."order by <field>" ;
    Set your condition from the popup list you mentioned. Without actually changing the query, I am not sure how this can be achieved.
     
    rosytoes, Aug 10, 2006 IP