Best way for saving infinit playlists (arrays) into db? (php mySql)

Posted by Ole Jak on Stack Overflow See other posts from Stack Overflow or by Ole Jak
Published on 2010-05-02T20:50:56Z Indexed on 2010/05/02 20:58 UTC
Read the original article Hit count: 250

Filed under:
|
|
|
|

So client gives me a string like "1,23,23,abc,ggg,544,tf4," from user 12 . There can be infinit number of elements with no spaces just value,value,... structure. I have users table (with users uId(key), names etc). I have streams table with ( sId(key), externalID, etc values). User sends me externalId's. And I need to hawe externalId's in play list (not my sId's). I need some way to store such array into my DB and be able to get it from DB.

I need to be able to do 2 things

  1. return such string back to user
  2. be able to get na array from it like {1; 23; 23; abc; ggg; 544; tf4;}

So what is best method (best here means shourt(small amount of) code)

  1. to store such data into db
  2. to retrivew stored tata in bouth ways shown

© Stack Overflow or respective owner

Related posts about php

Related posts about db