Display data from phpMyAdmin with WordPress

if you are trying to query from the same database in which your WordPress is installed then there is a great way to do sql query with ease. WordPress has a database access abstraction class called wpdb that allows you to run raw mysql query without any issue.

You can start using it like one of two methods bellow:

// 1st Method - Declaring $wpdb as global and using it to execute an SQL query statement that returns a PHP object
global $wpdb;
$results = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE option_id = 1", OBJECT );

or

// 2nd Method - Utilizing the $GLOBALS superglobal. Does not require global keyword ( but may not be best practice )
$results = $GLOBALS['wpdb']->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE option_id = 1", OBJECT );

Explore the documentation here and get started!