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 6861277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:30:52+00:00 2026-05-27T02:30:52+00:00

I have to create an application in PHP which will store the phone contacts

  • 0

I have to create an application in PHP which will store the phone contacts of different users.

The table for storing the phone numbers is of the following format:

id,user-id,phone-number

Whenever an user tries to view all his contacts, first of all the contents from the cache should be shown and then the remaining ones from the database.

In implementing this, I have the following problem:

How to store the phone numbers in the cache? By this I mean what should be the key for inserting the phone numbers into memcache so that I can easily extract the data from it for any user. Remember, each user can have many phone numbers and there are many users.

  • 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-27T02:30:53+00:00Added an answer on May 27, 2026 at 2:30 am

    the key should use user id

    user id { mobile number ... + list of contact ...[which is the user id]} 
    // by accessing this key able to get all mobile number
    // and his contact list
    

    suggestion value should be as simple as possible,
    no JSON, no serialize data

    user id {m:xxx,xxxx..., c:yyy,yyy,yyy}
    

    this is to save spaces and also save processing for json_decode / unserailize

    when getting all contacts for an user

    1. fetch cache using user id (one call)
    2. iterate the list of contact
    3. fetch parellel of all the contact (user) key * function handling
    4. iterate to build a multi dimensional array
    

    when user adding/update/delete a mobile number,
    or adding/update/delete a mobile number

    1. fetch cache using user id (one call)
    2. expire the key using user id
    3. iterate the cache result
    

    your function should be if cache not exist in memcache,
    fetch from database,
    set memcache,
    return the database result

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

Sidebar

Related Questions

I want to create an application which will have a client and server components.
In my web-application i have a form which contains about 25 fields. Users will
I have to create a DLL which is used by a VB6 application. This
I have seen the Contacts in iPhone Simulator. I want to create an application
I have a PHP MySQL application which has a modular design. There are about
I have build an C# Winforms application which will need regular updates and patches
Lets say I have an old application which will try to load an external
Here in my PHP application, I need to allow users to create a registration
I have an application with multiple users with different roles. Each users access to
I am trying to code an simple PHP application which will retrieve some information

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.