Cannot get wpdb data (Error in a simple fuction)
I'm using Cryto Plugin and want to get coin price data from plugin db.
For easy practice, I'm trying to get BTC data.
?php function get_coin_price($coin_symbol) {
global $wpdb;
$coin_price = $wpdb-get_var($wpdb-prepare(SELECT price FROM {$wpdb-prefix}cmc_coins_v2 WHERE symbol = '%s', $coin_symbol));
return $coin_price;
}?
And if I want to get BTC price, I use this code.
?php get_coin_price(BTC); ?
However I'm getting this error
Use of undefined constant BTC - assumed 'BTC' (this will throw an Error in a future version of PHP)
Is there a problem in data type? or maybe am I not using $wpdb-get_var or wpdb-prepare correctly?