I’m saving a string from PHP to MySQL like this..
$groupid = "13, 14, 15, 16"
$write = mysql_query("INSERT INTO table VALUES ('','$groupid')");
I’m then trying to extract data from the table if $a = “15”
$extract = mysql_query("SELECT * FROM table WHERE ustaffid='$ustaffid' AND groupid='$a'");
How can I easily match what’s in $groupid to $a, while extracting it? Can I do that with MySQL?
You can use the find_in_set function here.