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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:21:15+00:00 2026-05-15T23:21:15+00:00

In cases when some one needs to store more than one value in a

  • 0

In cases when some one needs to store more than one value in a in a cell, what approach is more desirable and advisable, storing it with delimiters or glue and exploding it into an array later for processing in the server side language of choice, for example.

$returnedFromDB = “159|160|161|162|163|164|165”;
$myIdArray = explode(“|”,$returnedFromDB);

or as a JSON or PHP serialized array, like this.

:6:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;}

then later unserialize it into an array and work with it,

OR

have a new row for every new entry like this

postid 12 | showto 2
postid 12 | showto 3
postid 12 | showto 5
postid 12 | showto 6
postid 12 | showto 8

instead of postid 12 | showto “2|3|4|6|8|5|”.
OR postid 12 | showto “:6:{i:0;i:2;i:1;i:3;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;}”.

Thanks, looking forward to your opinions 😀

  • 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-15T23:21:16+00:00Added an answer on May 15, 2026 at 11:21 pm

    In cases when some one needs to store more than one value in a in a cell, what approach is more desirable and advisable, storing it with delimiters or glue and exploding it into an array later for processing in the server side language of choice, for example.

    Neither. Oh goodness, neither! Edgar F. Codd is rolling in his grave right now.

    Storing delimited data in a text field is no better than storing it in a flat file. The data becomes unqueryable. Storing PHP serialized data in a text field is even worse because then only PHP can parse the data.

    You want a nice, happy, normalized database.

    The thing you’re trying to describe is a many-to-many relationship. Each user can maintain one or more posts. Likewise, each post can be maintained by one or more user. Right? Then something like this will work.

    CREATE TABLE users (
        user_id INTEGER PRIMARY KEY,
        ...
    );
    
    CREATE TABLE posts (
        post_id INTEGER PRIMARY KEY,
        ...
    );
    CREATE TABLE user_posts (
        user_id INTEGER REFERENCES users(user_id),
        post_id INTEGER REFERENCES posts(post_id),
        UNIQUE KEY(user_id, post_id)
    );
    
    -- All posts made by user 22.
    SELECT posts.*
      FROM posts, user_posts
     WHERE user_posts.user_id = 22
       AND posts.post_id = user_posts.post_id
    
    -- All users that worked on post 47
    SELECT users.*
      FROM users, user_posts
     WHERE user_posts.post_id = 47
       AND users.user_id = user_posts.user_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The users of my web application may have more than one browser window open
For example in some cases after POST or GET request I want to redirect
I have a problem where in some cases (appears to be where property type
I have a checkbox which in some cases may be disabled and checked using
I only want to show my title attribute in some cases. I don't want
Can somebody please demonstrate for me a more efficient Cartesian product algorithm than the
Wikipedia says on A* complexity the following ( link here ): More problematic than
I am writing my first real applet and I need to store some data.
If have a union that currently foresees some simple data types: union Value {
I'm trying to understand what happend when someone casts an object of one specific

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.