I've consistently noticed that when I try to use an array in a MySQL query that is within an Ajax Call (at least, I've only tried it from within an Ajax call) on a special-character-delimiter-separated string, my query only works if the character is a comma. For example, this works:
$myString = "String1,String2,String3,String4";
$ExplodedString = explode(",", $myString);
$sql = mysqli_query($cxn, "SELECT user FROM login WHERE column IN ('".implode("','", $ExplodedString)."') ORDER BY user");
But I can never get another special character, even the underscore, to return ANYTHING:
$myString = "String1_String2_String3_String4";
$ExplodedString = explode("_", $myString);
$sql = mysqli_query($cxn, "SELECT user FROM login WHERE column IN ('".implode("'_'", $ExplodedString)."') ORDER BY user");
//There are no error messages in my error log, even though error reporting is ON
Any ideas as to why?