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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:45:36+00:00 2026-05-27T09:45:36+00:00

My question is about tabulating data in MySql. I was wondering, how to best

  • 0

My question is about tabulating data in MySql. I was wondering, how to best represent this javascript array in MySql? What index should I use? I’m going to use the data to populate a javascript array via PHP.

A[i] represents a card. B[i] represents a matching card.

A = new Array();        
A[0] = new Array();
A[0][0]='eat';
A[0][1] = 1;
A[0][2] = 0;
A[1] = new Array();
A[1][0]='drink';
A[1][1] = 2;
A[1][2] = 0;


B = new Array();        
B[0] = new Array();
B[0][0]='tacos';
B[0][1] = 1;
B[0][2] = 0;
B[1] = new Array();
B[1][0]='tequila';
B[1][1] = 2;
B[1][2] = 0;

I need to be able to uniquely identify components within the array later, so that I can use parts of the data to populate new arrays (So I can use and combine different cards into a new array). For example, I might want to populate a new array in javascript using A[0][0], A[0][1], A[0][2],B[0][0], B[0][1] and info from another array stored in the MySql (Lets say Y[2][0], Y[2][1],Y[2][2],Z[2][0], Z[2][1]).

This is what I’ve come up with so far.

-----------------------------------------
|  card pair  | card |card info|Tag|Tag2|
-----------------------------------------
|      1      |   A  |   eat   | 1 |  0 | 
|      1      |   B  |  tacos  | 1 |  - |
|      2      |   A  |  drink  | 2 |  0 |
|      2      |   B  | tequila | 2 |  - |
-----------------------------------------

Maybe I need to add a primary index to the above one?

-------------------------------
|card pair |card info|Tag|Tag2|
-------------------------------
|      1A  |   eat   | 1 |  0 | 
|      1B  |  tacos  | 1 |  - |
|      2A  |  drink  | 2 |  0 |
|      2B  | tequila | 2 |  - |
-------------------------------

I thought the card pair could be the index. Not sure if this is possible or a good idea. Also not sure what type of index I would use if I did.

If you have a better way to tabulate the data or can recommend what type of index to use I’d much appreciate it.

EDIT: I think I can do away with the last 2 columns (Tag and Tag2), so I think I might just use the table as below.

----------------------
|card pair |card info|
----------------------
|      1A  |   eat   |
|      1B  |  tacos  |
|      2A  |  drink  | 
|      2B  | tequila |
----------------------

Should I add an incrementing index to the table? Is the card pair sufficient as the index?If yes, what is the best index type to use?

Thanks!

  • 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-27T09:45:36+00:00Added an answer on May 27, 2026 at 9:45 am

    well, from a database perspective, you will want to ‘normalize’ this information.

    I think it would be more like this:

    card
    ------------
    card_id
    info
    
    card_pair
    ------------
    card_1_id
    card_2_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question about best-practice. I'm using Kohana... is it okay to use helpers in
Question about header files in C++: when I should use them. If I write
This question about Timers for windows services got me thinking: Say I have (and
Newbie question about PostgreSQL. I'm migrating a MySQL/PHP app I've created, hosted on a
Quick question about the TransactionScope object. Found this on the internet: When you access
This question about web page 'inclusion' triggered my curiosity. The XML allows you to
This question about zip bombs naturally led me to the Wikipedia page on the
A question about C++ programming. Can you do in C++ something like this: Lecture
Question about Eclipse RCP and whole perspective/view/editor design - what is the best way
Question about this helper http://codeigniter.com/user_guide/helpers/download_helper.html If, for example, program.exe weights 4 GB, will it

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.