jamkelvl Posted February 2, 2010 Share Posted February 2, 2010 I am storing a serialized array in a column assigned_to the data looks like... a:1:{i:0;s:2:"LS";} What I want to do is look thru all the crazy data from the serialized array looking for "Unassigned" and "UN" all I've thought to try is: SELECT * FROM table WHERE assigned_to LIKE 'un%' ***EDIT**** <----- this works in phpmyadmin not in my php select... <?php $select = "SELECT * FROM jobs WHERE assigned_to like = '%u%'"; ?> but have had no results come up in php how can I do this (these select statements are in php so maybe I unserialize first or something?) Link to comment https://forums.phpfreaks.com/topic/190716-like-operator/ Share on other sites More sharing options...
lampstax Posted February 2, 2010 Share Posted February 2, 2010 You have an extra = there. It should be <?php $select = "SELECT * FROM jobs WHERE assigned_to like '%u%'"; ?> Link to comment https://forums.phpfreaks.com/topic/190716-like-operator/#findComment-1005750 Share on other sites More sharing options...
Maq Posted February 2, 2010 Share Posted February 2, 2010 SELECT * FROM table WHERE assigned_to LIKE 'un%' ***EDIT**** Are you sure they're not different...? http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like Link to comment https://forums.phpfreaks.com/topic/190716-like-operator/#findComment-1005770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.