A button from the front end is clicked which contains a specific keyword relative to the button. The value of the button is passed to PHP from JavaScript. I'm using this value to query the database and return the relative array. I'm receiving a null response when trying to query the result. If the query is changed to just select from the table, the arrays are returned. Any ideas as to why the result is returning Null. The string in the DB and the variable value both match.
//Get the string from front end to match against a database for the query
$loadDump = wp_unslash( $_POST['loadDump'] );
$loadDumpDecode = json_decode( $loadDump );
$table_name= $wpdb->prefix. 'product_configurator';
$DBP_results= $wpdb->get_results("SELECT * FROM $table_name WHERE keymap_key = '$loadDumpDecode'");
$DBP_current_user = get_current_user_id();
foreach($DBP_results as $DBP_cols){
$user_id= $DBP_cols->user_id;
$enclosure_type= $DBP_cols->enclosure_type;
$keymap_key= $DBP_cols->keymap_key;
$key_map_loaded= json_decode($DBP_cols->key_map);
}
echo json_encode($key_map_loaded);