Manixat Posted April 3, 2013 Share Posted April 3, 2013 Hello freaks, I'm looking for a way to select multiple IDs from a table based on a string of those IDs separated by a comma. The string in question is a record from another table. Now I can easily retrieve the string and perform various operations to assemble a new query, but it couldn't bother me more that there most probably is a correct way of doing this using only mysql. So I turn to you - is there such way? Link to comment https://forums.phpfreaks.com/topic/276482-selecting-multiple-ids-from-a-string/ Share on other sites More sharing options...
Barand Posted April 3, 2013 Share Posted April 3, 2013 Never store ids in comma separated lists. Normalize the data. Link to comment https://forums.phpfreaks.com/topic/276482-selecting-multiple-ids-from-a-string/#findComment-1422660 Share on other sites More sharing options...
Manixat Posted April 3, 2013 Author Share Posted April 3, 2013 Do you by normalize mean that I should create another table and relate them :/My apologies, I'm a self learner and that is what I just read about data normalization Link to comment https://forums.phpfreaks.com/topic/276482-selecting-multiple-ids-from-a-string/#findComment-1422667 Share on other sites More sharing options...
Psycho Posted April 3, 2013 Share Posted April 3, 2013 Do you by normalize mean that I should create another table and relate them :/ Yes. Link to comment https://forums.phpfreaks.com/topic/276482-selecting-multiple-ids-from-a-string/#findComment-1422668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.