Problem on displaying the results on my query

You need to use WordPress meta query:

Display posts where the custom field key is ‘extra1’ and the custom field value is ‘test’:

$query = new WP_Query( array( 'meta_key' => 'extra1', 'meta_value' => 'test' ) );

For more info take a look at WP Query Custom_Field_Parameters.