I am new to WordPress and I am trying to retrieve data from the database using wpdb.
I have created a custom template in order to add the PHP code but when I tried to display the retrieved data, it did not show anything.
where is the error ?
search info.php
<?php
/*
Template Name: search info
*/
get_header();
global $wpdb;
$result = $wpdb->get_var('select owner-name from owner-info where owner-id= 5');
echo $result;
get_footer();
?>