Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7628145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:33:21+00:00 2026-05-31T05:33:21+00:00

Say if you want to allow a user to be able to delete some

  • 0

Say if you want to allow a user to be able to delete some data, but typically it is static and good for caching. Is there a way to remove that value from the key so you can keep everything else cached and get rid of what the user wanted deleted? The key would be an array of many arrays. The arrays hold the info for the item like id, user name, title, etc. and would want to remove one of those arrays if the user wants to delete.

Example code:

Storing stuff:

    $cachedData = $this->memcache->get($this->key);
    if($cachedData === false){
        $cachedData = array();
        $sql = "SELECT id, name FROM table LIMIT 100";
        $res = mysql_query($sql);
        while($rec = mysql_fetch_assoc($res)){
            $cachedData[] = $rec;
        }
        // cache for 10 minutes
        $this->memcache->set($this->key, $cachedData, 0, 600);
    } 

It’s basically right from google code example.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:33:22+00:00Added an answer on May 31, 2026 at 5:33 am

    The only way to do this is to read the key’s value into a variable, modify the contents of that variable, and then write the entire key back to memcached.

    memcached operates completely at the top-level key:value layer; it doesn’t care nor understand what you put in it as values. As far as it’s concerned, that “array of arrays” you’re putting in as a value is just another string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say you want to allow some particular XML element to occur 0+ times.
Let's say I want to allow my developers to upload their war files to
let say i have a page , and i want to allow 3rd party
Say I want to manipulate some files on a floppy drive or a USB
say I want to scaffold generate university but university should eventually be related to
Say I want to do the simplest of the data passing as follows :
I want to allow some trusted users to scp files into my server (to
I want to allow bolding, italic ,underlines ,text-colors, etc in a UITextField. Is there
I have a purchase page and I don't want the user to be able
Say I want to have a method that takes any kind of number, is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.