upload data to server memory

Discussion in 'PHP' started by roice, Sep 21, 2012.

  1. #1
    Hello,

    I'm using PHP
    I understoad that its possible to upload value to the server memory
    Lets says that every user have table of prommissions for the website
    I don't want to do query for promission every time user load some page. I s it possible to load all prommission in advanced to the server memory and pull them every time he slide to a new page?

    Thank you in advanced,
    Roi.
     
    roice, Sep 21, 2012 IP
  2. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
  3. roice

    roice Peon

    Messages:
    200
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    does calling for session is better than create query for every page?
    and - do I need session for each permission?
     
    roice, Sep 21, 2012 IP
  4. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #4
    I would create a query for every page.

    Reason:
    If you store the permissions in a session and you want to change the permissions for a user that is currently logged in then the user will keep the original permissions unless you write some code to update the permissions in the session which means you are writing a query anyway.

    So I would always query the permissions on every page. db's are pretty fast and a single simple query won't take much processing power.
     
    plussy, Sep 21, 2012 IP
  5. pxranger

    pxranger Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    pxranger, Sep 21, 2012 IP