foshizl Posted September 5, 2008 Share Posted September 5, 2008 ok, i have a mysql db and the table i have has multiple fields all are text except one which is for an array my problem is Im trying to figure out how i can print the rows for only those who have a certain value in that field the field in my table is called "category" it is an array and is serialized, so how would I display only the rows that in the category field match (whatever ie: dogs). I hope someone can shed some light on this subject Link to comment https://forums.phpfreaks.com/topic/122842-help-with-array-query/ Share on other sites More sharing options...
ranjuvs Posted September 5, 2008 Share Posted September 5, 2008 My understanding is that the array will be stored as a string. so you could use normal search query using "like" to search for a particular text. SELECT * FROM table WHERE category like "%dog%; Link to comment https://forums.phpfreaks.com/topic/122842-help-with-array-query/#findComment-634401 Share on other sites More sharing options...
foshizl Posted September 5, 2008 Author Share Posted September 5, 2008 Thanks, I think that will work. going to have to make some changes to the way my DB stores into the array but in the long run it will be better Link to comment https://forums.phpfreaks.com/topic/122842-help-with-array-query/#findComment-634431 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.