Im having dificulties to get this little plugin running.
function latest_price(){
global $wpdb;
$result = $wpdb->get_results("SELECT bid,ask FROM wp_ticker ORDER BY indate DESC limit 1");
$price = $result[0]->bid;
return $price;
}
function outputprice(){
$output = $this->latest_price();
echo $output;
}
add_shortcode ('getprice', 'outputprice');
when i try to run this shortcode on a wordpress page, the page doesnt load. when i turn on debugging i dont see any errors though? Is this kind of structuring allowed or should i use OOP and put the functions in a class?