wp_query get data from advanced custom field in wordpress

ACF plugin stores data in the wp_postmeta like the default WordPress custom fields.

To get data from a custom field your code should look like this (assuming the custom field name is “brand_name”).

$title = get_the_title();
$the_query = new WP_Query( array(
  'posts_per_page'=>9,
  'post_type'=>'product_name',
  'order'   => 'ASC',
  'meta_query' => array(
    array( "key" => "brand_name", "value" => $title )
  ),
  'paged' => get_query_var('paged') ? get_query_var('paged') : 1) 
);

For more details on using meta fields in the WP_Query please see https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters