siwelis Posted March 22, 2010 Share Posted March 22, 2010 I'm thinking about storing some php arrays in mysql using serialize and unserialize... But I'm wondering if this is really a good idea... Does anyone have any light to shed on my situation? If necessary, I could break the arrays down into separate tables... but I really don't like having to access a bunch of different tables per page load. Thank you Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 22, 2010 Share Posted March 22, 2010 If the arrays have absolutely NO relation to one another (i.e. don't have common values) and you will NEVER need to query based upon those values the go ahead and serialize them. But, if that is not the case, then you should definitely store them in a separate, associated table. I wouldn't think you would need multiple tables (unless you are talking about multiple fields with different arrays). If necessary, I could break the arrays down into separate tables... but I really don't like having to access a bunch of different tables per page load. Why is that? It will be more efficient to have a separate table with the associated data and to get it in a single query than to have to query serialized values and then to unserialize it on-the-fly. Not to mention you lose the integrity of your data. Are you not comfortable using JOINs? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.