Jump to content

Inserting data into mysql efficiently


shinigaimi

Recommended Posts

Hey all I am inserting data into MySQL what would be the best way to do this for example this structure

 

  • stat_name"assist_count",
  • value_daily"9",
  • value_forever"6445",
  • value_monthly"349",
  • value_one_life_max"27",
  • value_weekly"203"

 

 

I can separate them in MySQL via , and use explode function to break it up is there a more efficient way to store the data ? I am importing the data from json 

Link to comment
Share on other sites

Allow me to vent: Why would you EVER want to do that?

Done.

 

Databases/tables are meant to store data in a meaningful and easily retrievable way. MySQL is a pretty efficient db. Of course you should create a column for each piece of data and store the data pieces in those columns.

 

If you did this thing you propose, how would you ever locate specific items of information without pulling down ALL the rows, exploding each of them and searching through the resulting arrays. That doesn't sound very efficient does it?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.