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
https://forums.phpfreaks.com/topic/279692-inserting-data-into-mysql-efficiently/
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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.