Winter0Star Posted June 13, 2011 Share Posted June 13, 2011 Going to make a site here soon and I need a little help. I will be storing an array of ID's into a MySQL database. I'm using the serialize function to store the array (however, I can change this if there is a better way). However, I want to be able to search for ID's directly through the MySQL statement. For example, I need to search for ID "254". I can't search through the serialized information unless I pull it out first. I want to be able to do something like this... SELECT name FROM table WHERE id_list = '$id' I'm looking for the best way to directly search for an ID. I hope this makes sense. Quote Link to comment Share on other sites More sharing options...
fugix Posted June 13, 2011 Share Posted June 13, 2011 instead of storing an array of id's into your database using serialize, why not create a field for storing your id's, and make it the primary key. If this is the way you would like to do it, your select mysql statement will be valid 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.