H, I am trying to get results from two tables with INNER JOIN in WordPress theme template file, but I don't know what's I am doing wrong. Please help me, here is the code below
global $wpdb;
$user_id = get_current_user_id();
$sql= "SELECT client_id FROM quotes INNER JOIN client_info ON quotes.client_id = client_info.id WHERE user_id =".$user_id;
// user_id column has the data current user_id in it
$results = $wpdb->get_results($sql);
print_r($results); // results displays an empty array but both tables have data